Redirect SMTP output in development environment

Published 24/02/2011 14:29 by valentin in Sysadmin


When developers want to code and test a mail feature, it's quite risky to use a SMTP server connected to the Internet, but on the other hand it's necessary to check all the process.

There is a really simple way to circumvent that and be sure not to send test emails to real users. The best way is to configure Postfix on developers' computers this way :

In /etc/postfix/main.cf

smtp_generic_maps = regexp:/etc/postfix/generic

In /etc/postfix/generic

/.*/ developer.email@test.com

Reload postfix and voila ! All mail sent by apps in development will be redirected to the developer.

1 Comment for "Redirect SMTP output in development environment"

  1. (Guest) martoche
    24/02/2011 14:33

    Thx Valentin, I was looking on how to do this for a long time and now I can happily test my application that sends emails!

Leave a comment

Captcha

Captcha