I want to set the bounce address or return path address to a particular email address(say [email protected]). Such that whenever a mail bounces it will send a reply to [email protected]. How can I do that using postfix ?
2 Answers
As per the RFC 2821, an NDR has to be sent to the "reverse-path" address specified with the MAIL FROM:
command during the SMTP dialogue:
If an SMTP server has accepted the task of relaying the mail and later finds that the destination is incorrect or that the mail cannot be delivered for some other reason, then it MUST construct an "undeliverable mail" notification message and send it to the originator of the undeliverable mail (as indicated by the reverse-path).
This behavior cannot be changed.
If you want an additional address to be notified whenever NDRs are sent by your system, take a look at the Postfix notify_classes and the bounce_notice_recipient directive
For details refer to the documentation for notify_classes and bounce_notice_recipient.
For your task add in /etc/postfix/main.cf
:
bounce_notice_recipient = [email protected]
Save the file, and run service postfix reload
. Now when you will send a bounce mail you will receive bounced mail at [email protected].
-
1I try this same but still its not working. I just need to set boune addrss no matter what is my from address– NaveenAug 2, 2018 at 5:29
-
@Naveen, it actually works, but you must use the
notify_classes
setting mentioned in the answer, because by default it is not enabled. Aug 16, 2022 at 6:50