[Dovecot] Postfix, mailbox_command, Dovecot deliver, LDAP and mail_location

Patrick Ben Koetter p at state-of-mind.de
Thu Jan 31 21:36:00 EET 2008


Timo,

thanks for picking up on this. Read the logs and my considerations below:

* Timo Sirainen <tss at iki.fi>:
> On Sun, 2008-01-27 at 19:25 +0100, Patrick Ben Koetter wrote:
> > > It is my understanding that mail_location only gets uses if no mail attribute 
> > > is specified. In any case, it appears that the above perhaps should read 
> > > mailHomeDirectory=mail. Also making the home and the mail directory the same 
> > 
> > Doh! Thanks, that fixed the mail location problem. In the log I can now see it
> > is used when I use dovecot as Postfix service.
> > 
> > The initial problem yet still remains. If I use "mailbox_command = ../deliver"
> > deliver seems to use the $ENV settings. I can probably change those, but I'd
> > rather have deliver read system user delivery options from LDAP, jsut as I do
> > for my virtual users.
> 
> That's how it should work. Also deliver v1.1 will clear out the
> environment by default.
> 
> > I've switched off all other userdb drivers. From my understanding deliver
> > _must_ read from LDAP:
> > 
> >   userdb:
> >       driver: ldap
> >       args: /etc/dovecot/dovecot-ldap.conf
> 
> It should. Set auth_debug=yes and mail_debug=yes. What does it log when
> delivering a mail?

The order of the log blocks is reversed. First I sent a mail over command line.
Then I logged using my MUA:

# Mail delivery
Jan 31 20:28:20 mail deliver(p): Loading modules from directory: /usr/lib/dovecot/modules/lda
Jan 31 20:28:20 mail deliver(p): Module loaded: /usr/lib/dovecot/modules/lda/lib10_quota_plugin.so
Jan 31 20:28:20 mail deliver(p): Module loaded: /usr/lib/dovecot/modules/lda/lib90_cmusieve_plugin.so
Jan 31 20:28:20 mail deliver(p): maildir: data=/home/p/Maildir
Jan 31 20:28:20 mail deliver(p): maildir: root=/home/p/Maildir, index=/home/p/Maildir, control=, inbox=
Jan 31 20:28:20 mail deliver(p): cmusieve: Using sieve path: /home/p/.dovecot.sieve
Jan 31 20:28:20 mail deliver(p): cmusieve: Executing script /home/p/.dovecot.sievec
Jan 31 20:28:20 mail amavis[26081]: (26081-09) Passed CLEAN, <root at state-of-mind.de> -> <p at state-of-mind.de>, Message-ID: <20080131192820.822F680CCAA at mail.state-of-mind.de>, mail_id: 28jhpw3tdpQd, Hits: 0.685, queued_as: A6F1B80CCA0, 226 ms
Jan 31 20:28:20 mail postfix/lmtp[32258]: 822F680CCAA: to=<p at state-of-mind.de>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.26, delays=0.03/0/0/0.23, dsn=2.6.0, status=sent (250 2.6.0 Ok, id=26081-09, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as A6F1B80CCA0)
Jan 31 20:28:20 mail postfix/qmgr[10756]: 822F680CCAA: removed
Jan 31 20:28:20 mail deliver(p): msgid=<20080131192820.822F680CCAA at mail.state-of-mind.de>: saved mail to INBOX


# Mail login
Jan 31 20:28:36 mail dovecot: auth(default): client in: AUTH^I1^ICRAM-MD5^Iservice=IMAP^Ilip=194.126.158.26^Irip=62.245.202.194
Jan 31 20:28:36 mail dovecot: auth(default): client out: CONT^I1^IPDA4MjU4MjkyMzAyNTYzMjUuMTIwMTgwNzcxNkBtYWlsPg==
Jan 31 20:28:36 mail dovecot: auth(default): client in: CONT<hidden>
Jan 31 20:28:36 mail dovecot: auth(default): ldap(p at state-of-mind.de,62.245.202.194): pass search: base=ou=customers,dc=state-of-mind,dc=de scope=subtree filter=(|(&(objectClass=PostfixBookMailAccount)(uniqueIdentifier=p at state-of-mind.de)(mailEnabled=TRUE))(&(objectClass=PostfixBookMailAccount)(mailAlias=p at state-of-mind.de)(mailEnabled=TRUE))) fields=uniqueIdentifier,userPassword
Jan 31 20:28:36 mail dovecot: auth(default): ldap(p at state-of-mind.de,62.245.202.194): result: uniqueIdentifier(user)=p at state-of-mind.de userPassword(password)=<hidden>
Jan 31 20:28:36 mail dovecot: auth(default): client out: OK^I1^Iuser=p at state-of-mind.de
Jan 31 20:28:36 mail dovecot: auth(default): master in: REQUEST^I2^I32303^I1
Jan 31 20:28:36 mail dovecot: auth(default): passwd(p at state-of-mind.de,62.245.202.194): lookup
Jan 31 20:28:36 mail dovecot: auth(default): passwd(p at state-of-mind.de,62.245.202.194): unknown user
Jan 31 20:28:36 mail dovecot: auth(default): ldap(p at state-of-mind.de,62.245.202.194): user search: base=ou=customers,dc=state-of-mind,dc=de scope=subtree filter=(|(&(objectClass=PostfixBookMailAccount)(uniqueIdentifier=p at state-of-mind.de))(&(objectClass=PostfixBookMailAccount)(mailAlias=p at state-of-mind.de))) fields=mailHomeDirectory,mailUidNumber,mailGidNumber,mailQuota,mailHomeDirectory
Jan 31 20:28:36 mail dovecot: auth(default): master out: USER^I2^Ip at state-of-mind.de^Iquota=maildir:storage=2621440^Iuid=1000^Igid=1000^Imail=/srv/mail/state-of-mind.de/p/Maildir
Jan 31 20:28:36 mail dovecot: imap-login: Login: user=<p at state-of-mind.de>, method=CRAM-MD5, rip=62.245.202.194, lip=194.126.158.26
Jan 31 20:28:36 mail dovecot: IMAP(p at state-of-mind.de): Loading modules from directory: /usr/lib/dovecot/modules/imap
Jan 31 20:28:36 mail dovecot: IMAP(p at state-of-mind.de): Module loaded: /usr/lib/dovecot/modules/imap/lib10_quota_plugin.so
Jan 31 20:28:36 mail dovecot: IMAP(p at state-of-mind.de): Module loaded: /usr/lib/dovecot/modules/imap/lib11_imap_quota_plugin.so
Jan 31 20:28:36 mail dovecot: IMAP(p at state-of-mind.de): Effective uid=1000, gid=1000, home=
Jan 31 20:28:36 mail dovecot: IMAP(p at state-of-mind.de): maildir: data=/srv/mail/state-of-mind.de/p/Maildir
Jan 31 20:28:36 mail dovecot: IMAP(p at state-of-mind.de): maildir: root=/srv/mail/state-of-mind.de/p/Maildir, index=/srv/mail/state-of-mind.de/p/Maildir, control=, inbox=

What irritates me, is that on Mail delivery deliver always claims to be
working for "p", while dovecot: auth says it does the job for
IMAP(p at state-of-mind.de). Both should be p at state-of-mind.de.

p at rick

-- 
state of mind
Agentur für Kommunikation, Design und Softwareentwicklung

Patrick Koetter            Tel: 089 45227227
Echinger Strasse 3         Fax: 089 45227226
85386 Eching               Web: http://www.state-of-mind.de

Amtsgericht München        Partnerschaftsregister PR 563


More information about the dovecot mailing list