I run my own mail server, which (among other things) handles emails for one of my services. The service in question takes bookings and sends booking confirmation emails. The emails come from [email protected] with a Reply To header set to the email address for the organizer.
Some email clients seem not to honor the Reply To header, and so I get emails sent to the [email protected] email.
I have setup postfix to catch these and run a script that looks up the event in question and replies to the email detailing the correct email address for the event, and this all works fine.
The problem is that I also get a lot of spam sent to that email address, so I would rather the reply was a bounce (rather than a new email) to discourage spam, but I'm not sure how to achieve this (or if it's even possible).
What makes a bounce email a bounce email? Does it have to be generated from the sending email server in response to an SMTP error? If so, how do I make it bounce and customize the bounce message (I'm using postfix and this method to run the script). If not, can I modify the email I send in the script to be a bounce email? How do I do this? Is it specific headers in the email?
A receiving MTA should never bounce. SMTP connection-stage rejection is the only way to avoid sending backscatter. Your script would soon become a tool for sending spam.
You can customize the human readable error message. Every sending MTA getting the error from yours will create a bounce with their usual template, but the error message is always somewhere.
A customer should have had bounces before and realize there was something wrong with the recipient address. At least some of them care to try and find your error message, or ask someone who can... read them English.
Example configuration for a custom error message in Postfix:
Postfix
main.cf
:/etc/postfix/denied_recipients
:postmap /etc/postfix/denied_recipients
, because it's ahash:
Berkeley DB.The entire point of a "[email protected]" address is that it doesn't go anywhere.
Put the address to which you want people to reply in the body of the mail, and remove the noreply mailbox from your server(s). In this way everybody sending to the noreply address gets their mail bounced - including spammers - but all literate and legitimate users will know how to get a mail through to the correct address.