Hi list,

I recently completed my first OpenSMTPD-based mail setup and in
general, things seem to work very well. Testing some edge cases,
however, I ran into something I cannot understand.

In the event that the local delivery fails with a 5xx error, OpenSMTPD
queues the message for retry (and eventually supplies the sender with
a "delayed" delivery notification, etc). My naive expectation is that
SMTP 5xx means permanent failure, so an immediate bounce would be more
appropriate.

I can provoke this on two occasions:

1. User does not exist:

Apr 8 08:03:45 mail smtpd[26476]: 5d56b355f19e7a92 mda delivery
evpid=9d6aa2bcd0d53c97 from=<t...@example.com>
to=<nosuchaddr...@example.com> rcpt=<nosuchaddr...@example.com>
user=vmail delay=10s result=TempFail stat=Error (temporary failure:
"mail.lmtp: LMTP server error: 550 5.1.1 <nosuchaddr...@example.com>
User doesn't exist: nosuchaddr...@example.com")

2. User quota is full:

Apr 8 07:45:39 mail smtpd[1517]: 65b4cb1b1ad15fa4 mda delivery
evpid=3a1e3c3302257a66 from=<t...@example.com>
to=<iamf...@example.com> rcpt=<iamf...@example.com> user=vmail
delay=10s result=TempFail stat=Error (temporary failure: "mail.lmtp:
LMTP server error: 552 5.2.2 <t...@example.com> Quota exceeded
(mailbox for user is full)")


In both the above occasions, I would prefer if OpenSMTPD bounced the
incoming email immediately, instead of spending resources on queueing
and retrying it. Why is the 5xx from LMTP treated as a TempFail?
Can this be changed somehow?

My setup is pretty basic and does not deviate much from the one
published in the excellent "Setting up a mail server with OpenSMTPD,
Dovecot and Rspamd" by Gilles. I mostly added stuff on the
Dovecot/Rspamd side only (virtual users, quotas, sieve, etc).

Local delivery is handed over to Dovecot via:
  action "domain_mail" lmtp "/var/dovecot/lmtp" rcpt-to virtual <virtuals>

I cannot see anything related in the configuration (I assume it must
be OpenSMTPD since Dovecot answers with a correct 5xx code). I went
through the man page a couple times and searched the web, but I
haven't found anything related.

This is OpenSMTPD 6.7.0 on OpenBSD 6.8 (+syspatch).

Any insight would be highly appreciated!

Many thanks,
Tom

Reply via email to