add config option to reject incoming deliveries with an error during the smtp transaction

useful when a catchall is configured, and messages to some address need to be
rejected.

would have been nicer if this could be part of a ruleset. but evaluating a
ruleset requires us to have the message (so we can match on headers, etc). but
we can't reject messages to individual recipients during the DATA command in
smtp. that would reject the entire delivery attempt.

for issue #156 by ally9335
This commit is contained in:
Mechiel Lukkien
2025-01-24 16:51:21 +01:00
parent 8b26e3c972
commit 3e2695323c
13 changed files with 115 additions and 11 deletions

View File

@ -1120,6 +1120,17 @@ See https://pkg.go.dev/github.com/mjl-/sconf for details.
# Free-form comments. (optional)
Comment:
# If non-empty, incoming delivery attempts to this destination will be rejected
# during SMTP RCPT TO with this error response line. Useful when a catchall
# address is configured for the domain and messages to some addresses should be
# rejected. The response line must start with an error code. Currently the
# following error resonse codes are allowed: 421 (temporary local error), 550
# (user not found). If the line consists of only an error code, an appropriate
# error message is added. Rejecting messages with a 4xx code invites later retries
# by the remote, while 5xx codes should prevent further delivery attempts.
# (optional)
SMTPError:
# Full name to use in message From header when composing messages coming from this
# address with webmail. (optional)
FullName: