Narcis Garcia
2022-Jan-28 09:27 UTC
LMTP error on trying to find passwd-file for Postfix recipient validation
Hello everyone, I have following configurations (and more) at /etc/dovecot/local.conf in a "/VirtualUserFlatFilesPostfix/" setup : [partial file content begins] protocols = imap pop3 lmtp sieve mail_location = maildir:~/data:INBOX=~/data/.INBOX service lmtp { ??? unix_listener /var/spool/postfix/private/dovecot-lmtp { ??? ??? user = vmail ??? ??? group = vmail ??? ??? mode = 0660 ??? } } protocol lmtp { ??? postmaster_address = postmaster at example.net ??? mail_plugins = $mail_plugins sieve } userdb { ??? driver = passwd-file ??? args = username_format=%u /srv/vmail/domains.d/%d/users.d/%n/etc/passwd } passdb { ?? ?driver = passwd-file ??? args = username_format=%u /srv/vmail/domains.d/%d/users.d/%n/etc/shadow.%Ls } service auth { ??? unix_listener /var/spool/postfix/private/auth { ??? ??? user = postfix ??? ??? group = postfix ??? ??? mode = 0660 ??? } } [/partial file content ends] Everyting works (IMAP mail is stored, IMAP/POP3 mail is retrieved, incoming SMTP mail from Postfix is delivered, Outgoing SMTP senders are authenticated from Postfix~SASL) BUT: When incoming mail goes to a mailbox that does not exist, an error is logged by Dovecot, letter remains at Postfix queue, and no rejection message to sender (here host is /mail.example.net/): [partial]$ cat /var/log/mail.log 2022-01-28T08:52:00.851751+01:00 correo postfix/smtpd[1853]: CFDA63A174B: client=mail.example.com[1.2.3.4] 2022-01-28T08:52:00.872248+01:00 correo postfix/cleanup[1881]: CFDA63A174B: message-id=<83c79ee1-6e2e-4e15-307e-17cdc7e2b814 at example.com> 2022-01-28T08:52:00.884100+01:00 correo postfix/qmgr[1529]: CFDA63A174B: from=<johndoe at example.com>, size=854, nrcpt=1 (queue active) 2022-01-28T08:52:00.884507+01:00 correo postfix/smtpd[1853]: disconnect from mail.example.com[1.2.3.4] ehlo=2 starttls=1 mail=1 rcpt=1 data=1 quit=1 commands=7 2022-01-28T08:52:00.969275+01:00 correo postfix/lmtp[1882]: CFDA63A174B: to=<wronguser at example.net>, relay=mail.example.net[private/dovecot-lmtp], delay=0.43, delays=0.35/0.02/0.02/0.05, dsn=4.3.0, status=deferred (host mail.example.net[private/dovecot-lmtp] said: 451 4.3.0 <wronguser at example.net> Temporary internal error (in reply to RCPT TO command)) [partial]$ cat /var/log/dovecot.log 2022-01-28 08:52:00 lmtp(1883): Info: Connect from local 2022-01-28 08:52:00 auth: Error: passwd-file(wronguser at example.net): stat(/srv/vmail/domains.d/example.net/users.d/wronguser/etc/passwd) failed: Address family not supported by protocol 2022-01-28 08:52:00 lmtp(wronguser at example.net)<1883><xbrsNqCg82FbBwAAzZSvjA>: Error: user wronguser at example.net: Auth USER lookup failed 2022-01-28 08:52:00 lmtp(1883): Error: Failed to lookup user wronguser at example.net: Internal error occurred. Refer to server log for more information. 2022-01-28 08:52:00 lmtp(1883): Info: Disconnect from local: Client has quit the connection (state=READY) Thank you for any help in debugging configuration or suggestion to enhance Postfix/Dovecot parameters. Postfix 3.4 Dovecot 2.3 -- Narcis Garcia __________ I'm using this dedicated address because personal addresses aren't masked enough at this mail public archive. Public archive administrator should fix this against automated addresses collectors. -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://dovecot.org/pipermail/dovecot/attachments/20220128/b5560ea1/attachment.htm>
Bernardo Reino
2022-Jan-28 11:50 UTC
LMTP error on trying to find passwd-file for Postfix recipient validation
On Fri, 28 Jan 2022, Narcis Garcia wrote:> Hello everyone, > > I have following configurations (and more) at /etc/dovecot/local.conf in a > "/VirtualUserFlatFilesPostfix/" setup : > > [partial file content begins][snip]> When incoming mail goes to a mailbox that does not exist, an error is logged > by Dovecot, letter remains at Postfix queue, and no rejection message to > sender (here host is /mail.example.net/):Wouldn't it make sense to prevent postfix from attempting to deliver (via LMTP) messages addressed to invalid users? i.e. using virtual_mailbox_maps and/or virtual_alias_maps, as needed.> [partial]$ cat /var/log/dovecot.log > > 2022-01-28 08:52:00 lmtp(1883): Info: Connect from local > 2022-01-28 08:52:00 auth: Error: passwd-file(wronguser at example.net): > stat(/srv/vmail/domains.d/example.net/users.d/wronguser/etc/passwd) failed: > Address family not supported by protocol^^^ weird message, but maybe it's dovecot's way of saying "file not found" :) Good luck.