I am using postfix+maildrop+mysql on my server (virtual users). All
settings are ok and works fine.
According to maildropmysql.config i tryed to use where_clause option but
is not working at all!
# cat maildropmysql.config
....
homedirectory_field home
quota_field quota
mailstatus_field smtpstat
# MYSQL_DEFAULT_WHERE_CLAUSE - This is optional !
# It can be set to any fixed string starting with keyword 'AND'.
# It will then be appended to the WHERE clause of our query.
#where_clause ""
where_clause "'AND' smtpstat=1"
According to this settings, the query made it to mysql database MUST
SHOW something like:
SELECT address, uid, gid, home, maildir, quota, smtpstat FROM users
WHERE address = "al...@test.ro" AND smtpstat=1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
THE PROBLEM IS NOTHING WILL BE APPEDED TO THE END OF THIS QUERY! I CAN
SEE JUST:
SELECT address, uid, gid, home, maildir, quota, smtpstat FROM users
WHERE address = "al...@test.ro"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
After few tests, i think that i found a BUG in this version of maildrop!
Can anybody tell me WHY is completely IGNORED anything i write in
where_clause AND NO MYSQL ERROR????
Want a demo? See below (WHAT'S HAPPEND WHEN I WRITE SOME IDIOT THINGS
IN where clause)
# cat maildropmysql.config
....
homedirectory_field home
quota_field quota
mailstatus_field smtpstat
# MYSQL_DEFAULT_WHERE_CLAUSE - This is optional !
# It can be set to any fixed string starting with keyword 'AND'.
# It will then be appended to the WHERE clause of our query.
#where_clause ""
#where_clause "'AND' smtpstat=1"
where_clause "LETS'S GO TO THE PARY TO NIGHT"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Now i send a message locally.
# tail -f /var/log/mysqld.log
021126 17:51:07 255 Connect postfix@localhost on
255 Init DB maildb
255 Query SELECT address, uid, gid, home, maildir, quota, smtpstat FROM
users WHERE address = "al...@test.ro"
255 Quit
No error in mysql query!!!!!!!!!!!!!!!!!!!!!!!!
# tail -f /var/log/maillog
Nov 26 17:51:06 dinu postfix/qmgr[5430]: 5E0A320A69:
from=<ti...@test.ro>, size=557, nrcpt=1 (queue active)
Nov 26 17:51:08 dinu postfix/pipe[5973]: 5E0A320A69: to=<al...@test.ro>,
relay=maildrop, delay=5, status=sent (ns1.test.ro)
SO, THE MAIL HAS GONE!!!!!!!!!!!!!!!!
Can anybody fix this problem?
Try to apply attached patches to 1.5.0 sources. maildrop-1.4.0-config.patch
Change some configuration defaults and contains some comments about SQL (!).
maildrop-1.4.0-mysqlfix.patch - add posibility for using spaces (' ') in the
'where_clause'.
Hope this help ... ;)