Installed dovecot for the first time, using the FreeBSD port. Found 2 issues with the port, and I've only been able to resolve one of them.
First of all, the port, (or perhaps dovecot) does work with mysql 4.1 encryption. I had to create a user with access to the mysql table, then do 'set password = old_password('password');' in order to get dovecot to talk to the server.
The second issue, is that dovecot seems to be ignoring my user_query settings. I have the following in dovecot-sql.conf:
password_query = SELECT password FROM mailbox WHERE username = '%u' user_query = SELECT maildir, 125 as uid, 125 as gid FROM mailbox WHERE username = '%u'
The password query works, however the user query seems to default to something else, and no matter how I change the user_query line in dovecot-sql.conf, it uses the same query. Here's an excerpt from my logs:
dovecot: Oct 11 03:19:30 Info: Dovecot v1.0.alpha3 starting up dovecot: Oct 11 03:19:31 Info: auth-worker(default): mysql: Connected to (null) (postfix) dovecot: Oct 11 03:19:35 Info: auth-worker(default): sql(user@example.com,1.2.3.4): query: SELECT password FROM mailbox WHERE username = 'user@example.com' dovecot: Oct 11 03:19:35 Info: auth(default): client in: AUTH 1 PLAIN service=IMAP secured lip=5.6.7.8 rip=1.2.3.4 resp=AGJqZXVuZ0Bjb2JhbHQtaXQuY29tAHRlc3Q= dovecot: Oct 11 03:19:35 Info: auth(default): client out: OK 1 user=user@example.com dovecot: Oct 11 03:19:35 Info: auth(default): master in: REQUEST 1 13590 1 dovecot: Oct 11 03:19:35 Info: auth-worker(default): sql(user@example.com,1.2.3.4): SELECT home, uid, gid FROM users WHERE userid = 'user@example.com' dovecot: Oct 11 03:19:35 Error: auth-worker(default): sql(user@example.com,1.2.3.4): User query failed: Table 'postfix.users' doesn't exist dovecot: Oct 11 03:19:35 Info: imap-login: Internal login failure: user=user@example.com, method=PLAIN, rip=67.188.145.230, lip=209.25.157.150, TLS
So obviously the query fails because that table doesn't exist. However that's not the query that I have in the configuration file. As a matter of fact, I have no idea where it's pulling that query from. Any pointers would be greatly appreciated.