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@domain.tld/Maildir or /home/mainuser/domains/domain2.tld/homes/user@domain2.tld/Maildir
which have the main user as a group and user@domain.tld/user@domain2.tld as owner
Postfix have virtual_alias_maps = hash:/etc/postfix/virtual
there in virtual file there is map like:
user@domain.tld user-domain@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@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??