I am sending emails for newsletter subscription, where I get a lot of spam by bots.
Now I would like to send the opt-in email for the newsletter in a way that the mail server does not return any bounces to me.
I know I can set Return-Path
to an unused mail account, but how to tell the mail server not to send any bounces? Any way I can set it to void?
I looked at RFC 5321 but I did not find anything for my case. Return-Path is defined as:
Return-path-line = "Return-Path:" FWS Reverse-path <CRLF>
FWS
is defined in RFC 5322:
FWS = ([*WSP CRLF] 1*WSP) / obs-FWS
; Folding white space
Or is there any other header for this?
CodePudding user response:
You need to set the envelope from, in sendmail that is the -f
parameter:
-f sender
Set the envelope sender address. This is the address where de‐
livery problems are sent to. With Postfix versions before 2.1,
the Errors-To: message header overrides the error return ad‐
dress.
I still would suggest to use a valid mail address and just discard the mail. Not sure if it would cause trouble for example with SPAM reputation if you use @example.com
or @example.invalid
CodePudding user response:
Return-Path
is set by the mail server you send the mail to. As a sender you can not (or should not) set it yourself. But you can set From
and Reply-To
to [email protected]
because example.com is a reserved domain.
That should do the trick.