lmtp userdb can't resolve users
George Asenov
george.asenov at wpx.net
Fri Oct 21 07:18:36 UTC 2022
Hello,
I use postfix with dovecot as an lmtp LDA with unix users and multiple
domain names and mailboxes in Maildir format placed in domain directory
like:
/home/mainuser/homes/user at domain.tld/Maildir
or
/home/mainuser/domains/domain2.tld/homes/user at domain2.tld/Maildir
which have the main user as a group and user at domain.tld/user at domain2.tld
as owner
Postfix have
virtual_alias_maps = hash:/etc/postfix/virtual
there in virtual file there is map like:
user at domain.tld user-domain at domain.tld
and in /etc/passwd
there are actually 2 users with the same home dir and
same UID/GID (only the username is different)
and in postfix
mailbox_transport = lmtp:unix:private/dovecot-lmtp
The issue is that when postfix passes the email for local delivery to
dovecot lmtp it sends the username as user-domain.tld at serverhostname.tld
but dovecot is configured with
!include auth-system.conf.ext
can't resolve this username thus fails to deliver.
I've found a workaround in the net to use custom userdb just for lmtp
like this:
protocol lmtp {
mail_plugins = $mail_plugins sieve
userdb {
driver = passwd-file
args = username_format=%n /etc/passwd
}
}
which works but produce some warnings because there is the root user (ID
0) and actually is a dirty workaround
Is there more elegant solution??
More information about the dovecot
mailing list