Skip to content

Testing emails in a safe way

Laurent 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/main.cf:

smtp_generic_maps = regexp:/etc/postfix/generic

And into /etc/postfix/generic:

/.*/ laurentb+test@theodo.fr

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!