Discussion:
Forwarding error codes from remote SMTP servers back to original client
(too old to reply)
Drew
2015-01-21 23:39:00 UTC
Permalink
I have configured a Postfix server which is being used by various internal SMTP clients to send mail. I have enabled SASL+Cyrus and TLS successfully, and have the following restrictions configured in main.cf:

smtpd_client_restrictions = permit_sasl_authenticated, reject
smtpd_relay_restrictions = permit_sasl_authenticated, reject
# reject messages upon the MAIL FROM command when domain is invalid
smtpd_sender_restrictions = reject_unknown_sender_domain
# reject messages upon the RCPT TO command when domain is invalid
smtpd_recipient_restrictions = reject_unknown_recipient_domain

However, in its current state, Postfix does not behave in the way I'd like for the following scenario:

A client attempts to use my server to send an e-mail to "***@yahoo.com", and at the moment, that is not a valid Yahoo e-mail address, so the distant Yahoo SMTP server responds with the error code: "554 delivery error: dd This user doesn't have a yahoo.com account (***@yahoo.com)."

However, my Postfix server does not "forward" that 554 error code back to the original SMTP client, which is what I'd like to happen; rather, it simply responds with a 250 OK.

How do I configure Postfix to forward back error codes from remote SMTP servers back to the original client, instead of responding with 250 OK?

Thanks a bunch,
Drew
Drew
2015-01-23 01:55:00 UTC
Permalink
After more research, I now realize that my desired behavior can be achieved via Postfix's "Address Verification" mechanism (i.e., adding reject_unverified_recipient to smtpd_recipient_restrictions, and if desired changing smtp_address_verify_target). However, I also realize that this will result in a slower SMTP server, as for each incoming SMTP request, there will be an additional SMTP "probe" sent out for verification.
Loading...