Skip to content

Testing emails in a safe way

June 30, 2011Laurent Bachelier1 min read

Fear you will send the unwanted emails to other people when testing your software?
If you use Postfix, you can follow these simple steps:

Put into /etc/postfix/

smtp_generic_maps = regexp:/etc/postfix/generic

And into /etc/postfix/generic:


Reload postfix (this might depend on your distribution):

# /etc/init.d/postfix reload

This will rewrite all emails sent from your machine to send only to the email address provided.
Of course, change the destination email. I get enough emails already!