Postfix → Dovecot LMTP: User does not exist: uid@domain

I am trying to have Postfix deliver local mails via Dovecot's LMTP (among other things to replace procmail with sieve). Up to now, I've been using mailbox_command = procmail - a "$EXTENSION", delivering to local ~/Maildirs.

Following http://wiki2.dovecot.org/HowTo/PostfixDovecotLMTP, I configured (postfix is chrooted) in /etc/dovecot/conf.d/10-master.conf

service lmtp {
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
    group=postfix
    user=postfix
    mode=0600
  }

and added to /etc/postfix/main.cf

mailbox_transport = lmtp:unix:private/dovecot-lmtp

Now, that almost works (Postfix talks to the LMTP socket), but LMTP is confused about the "user" [email protected] containg the domain:

Jan 11 08:22:17 s18015955 postfix/lmtp[7374]: 3D84E19B0290E: to=<[email protected]>, orig_to=<[email protected]>, relay=iota.mydomain.eu[private/dovecot-lmtp], delay=0.01, delays=0/0/0/0, dsn=5.1.1, status=bounced (host iota.mydomain.eu[private/dovecot-lmtp] said: 550 5.1.1 <[email protected]> User doesn't exist: [email protected] (in reply to RCPT TO command))

LMTP should be looking just for eudoxos (in LDAP) instead of [email protected]. How can I achieve that?

If I were using delivery program (LDA), recipient username is specified as argument (like mailbox_command = /usr/lib/dovecot/deliver -f "$SENDER" -a "$RECIPIENT"), but I had issues with log permissions using LDA (Dovecot wiki discourages using LDA for that reason).


You need to set:

auth_username_format = %Ln

In conf.d/10-auth.conf

That removes the domain name, and the '@'.


The solution was to set

user_filter = (&(objectClass=posixAccount)(uid=%n)

in /etc/dovecot/dovecot-ldap.conf.ext.