On 18 Mar 2019, at 8:40, Otto Kekäläinen wrote:
Hello!
My goal is to prevent our system from sending email to addresses that
for sure does not work, and attempt to send only email that has a
chance of being delivered.
I have this in my Postfix configuration:
smtpd_recipient_restrictions =
reject_non_fqdn_recipient,
reject_unknown_recipient_domain,
check_recipient_access hash:/etc/postfix/recipient_access
And recipient_access contents:
@example.com reject
If somebody sends email to j...@example.com the email is rejected as
expected. Also, as expected, if somebody sends email with
"john@example" the email is not delivered since "example" is not a
fully qualified domain.
However if the email has multiple recipients and all other addresses
are valid but one, the whole mail is rejected by Postfix.
No, it is not. A single RCPT command is rejected. If additional RCPT
commands are issued and accepted (and no other problems exist) Postfix
will allow the DATA command and pass along the message to the accepted
recipients.
A mail client can and should issue a RCPT command for each recipient and
continue to DATA if any RCPT command is accepted. Many clients will not
do so, but Postfix can't fix that problem.
Example:
$ example-sendmail-wrapper "To: j...@real-address.com, john@example"
sendmail: recipient address john@example not accepted by the server
sendmail: server message: 450 4.1.2 <john@example>: Recipient address
rejected: Domain not found
That should logically be a '553' error, although the Postfix default is
'450' due to an abundance of caution by Dr. Venema...
Your mail client MIGHT handle the rejection correctly if you change
unknown_address_reject_code to 553.
Rejecting john@example is correct here. However, when this happens,
j...@real-address.com will not get her message, which is a problem.
This is an indication of poor *client* behavior.
How can I configure Postfix so that _only_ malformed addresses are not
delivered to the next SMTP host, while the rest of the recipients in
the same email/To/CC/BCC are delivered as usual?
1. Try adding "unknown_address_reject_code = 553" in main.cf. This is a
wise choice in any case.
2. Use a better mail client which handles multiple recipient mail more
robustly.
--
Bill Cole
b...@scconsult.com or billc...@apache.org
(AKA @grumpybozo and many *@billmail.scconsult.com addresses)
Available For Hire: https://linkedin.com/in/billcole