[Dovecot] Problems with deliver and account resolving
Hi! I'm currently setting up my first mailsystem based on dovecot. For a far way, working with dovecot was very convenient, but after I had to integrate deliver, it became massivly painful. My components are postfix as MTA, postgresql as user database and dovecot as IMAP server. When translating the mail adresse into the account name, something goes terribly wrong (Mail adresses modified to protect against spam, think about them in correct format):
dovecot: Jul 22 01:48:13 Info: auth(default-listen): master in: USER 1 Andreas.Podgurski_at_MediaGUILD.de service=deliver dovecot: Jul 22 01:48:13 Info: auth(default-listen): prefetch(Andreas.Podgurski_at_MediaGUILD.de): passdb didn't return userdb entries, trying the next userdb dovecot: Jul 22 01:48:13 Info: auth(default-listen): sql(Andreas.Podgurski_at_MediaGUILD.de): SELECT 1011 AS uid,1011 AS gid,'/var/www/jade/mail/' || admin.username AS home,admin.username AS user FROM admin,email WHERE lower(email.local_address) = lower('Andreas.Podgurski') AND email.receiver = admin.id; dovecot: Jul 22 01:48:13 Info: auth(default-listen): auth(Andreas.Podgurski_at_MediaGUILD.de): username changed Andreas.Podgurski_at_MediaGUILD.de -> SunAdmin dovecot: Jul 22 01:48:13 Info: auth(default-listen): master out: USER 1 SunAdmin uid=1011 gid=1011 home=/var/www/jade/mail/SunAdmin deliver(Andreas.Podgurski_at_MediaGUILD.de): Jul 22 01:48:13 Error: mkdir(/var/www/jade/mail/Andreas.Podgurski_at_MediaGUILD.de/cur) failed: Permission denied deliver(Andreas.Podgurski_at_MediaGUILD.de): Jul 22 01:48:13 Info: msgid=20080721234813.302260@gmx.net: save failed to INBOX: Internal error occurred. Refer to server log for more information. [2008-07-22 01:48:13]
As you can see, the account SunAdmin has an email adresse andreas.podgurski_at_mediaguild.de assigned. The database seems to reveil the username correctly, but after that, deliver continues to use the original mail adresse, not the account name returned by the auth master. Any idea, where my solution went the wrong way? The uid/gid belong to vmail:vmail, which is used for the auth-master, as well as for running deliver and to dispatch the postfix messages. Btw., I ask myself, how dovecot can assume to use prefetch in this case, as prefetch bases upon the password query, which has to fail in this case, as there is no password. Shouldn't it not even try to use the prefetch values there...?
Thanks in advance, Andreas Podgurski
-- Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger
On Tue, 2008-07-22 at 02:04 +0200, Andreas Podgurski wrote:
dovecot: Jul 22 01:48:13 Info: auth(default-listen): auth(Andreas.Podgurski_at_MediaGUILD.de): username changed Andreas.Podgurski_at_MediaGUILD.de -> SunAdmin
deliver ignores this username change. It probably shouldn't, but I'm not going to change it for v1.1.x anymore. Have you thought about doing this change in MTA aliases instead?
dovecot: Jul 22 01:48:13 Info: auth(default-listen): master out: USER 1 SunAdmin uid=1011 gid=1011 home=/var/www/jade/mail/SunAdmin
The home directory is correct.
deliver(Andreas.Podgurski_at_MediaGUILD.de): Jul 22 01:48:13 Error: mkdir(/var/www/jade/mail/Andreas.Podgurski_at_MediaGUILD.de/cur) failed: Permission denied
This shows that you're not using the home directory in mail_location, but you've explicitly specified it to use %u, which wasn't updated in deliver.
Btw., I ask myself, how dovecot can assume to use prefetch in this case, as prefetch bases upon the password query, which has to fail in this case, as there is no password. Shouldn't it not even try to use the prefetch values there...?
prefetch userdb is internally handled just like any other. The extra work done by calling it is near nonexistent and the only time you see it is with auth_verbose=yes. But I suppose it's a bit pointless to log that line with userdb lookups. Fixed: http://hg.dovecot.org/dovecot-1.1/rev/ba6045b0b90f
participants (2)
-
Andreas Podgurski
-
Timo Sirainen