Hello,
I've configured MySQL authentication as follows.
-- divecot-sql.conf --
driver = mysql connect = host=localhost dbname=postfix user=myuser password=mypass default_pass_scheme = PLAIN password_query = SELECT password FROM mailbox WHERE username = '%u' user_query = SELECT CONCAT('/var/vmail/', maildir, 'Maildir') AS home, '1234' AS uid, '1234' AS gid FROM mailbox WHERE username = '%u'
-- dovecot.conf --
passdb sql { args = /usr/local/etc/dovecot-sql.conf } userdb sql { args = /usr/local/etc/dovecot-sql.conf }
And both access (IMAP) and delivery (LDA) work correctly. Now I want to setup prefetching to reduce SQL queries, so I did
-- dovecot-sql.conf --
driver = mysql connect = host=localhost dbname=postfix user=myuser password=mypass default_pass_scheme = PLAIN password_query = SELECT password, CONCAT('/var/vmail/', maildir, 'Maildir') AS userdb_home, '1234' AS userdb_uid, '1234' AS userdb_gid FROM mailbox WHERE username = '%u'
-- dovecot.conf --
passdb sql { args = /usr/local/etc/dovecot-sql.conf } userdb prefetch { }
Dovecot mail access (IMAP) works correctly, but when the LDA tries to deliver mail I get:
May 11 16:25:00 ns1 dovecot: auth(default): prefetch(luca@example.com): passdb didn't return userdb entries May 11 16:25:00 ns1 postfix/pipe[11040]: 21E31847BC: to=<luca@example.com>, relay=dovecot, delay=0, status=bounced (user unknown)
thanks
-- Luca Corti PGP Key ID 1F38C091 BOFH excuse of the moment: user to computer ration too low.