How do I set up postfix to store e-mail in a file instead of relaying it?

Posted by GomoX on Server Fault See other posts from Server Fault or by GomoX
Published on 2012-11-22T13:56:00Z Indexed on 2012/11/22 17:01 UTC
Read the original article Hit count: 186

Filed under:
|
|

I want to run a staging copy of a production server on a local environment. The system runs a PHP application, which sends e-mail to customers in various scenarios and I want to make sure no e-mail is ever sent from the staging environment.

I can tweak the code so it uses a dummy e-mail sender, but i'd like to run the exact same code as the production environment. I can use a different MTA (Postfix is just what we use in production), but I'd like something that is easy to set up under Debian/Ubuntu :)

So, I'd like to set up the local Postfix install to store all e-mail in (one or more) files instead of relaying it. Actually, I don't really care how it's stored as long as it's feasible to check the e-mail that was sent. Even a set up option that tells postfix to keep the e-mail in the mail queue would work (I can purge the queue when I reload the staging server with a copy from production).

I know this is possible, I just haven't found any good solution online for what seems like a fairly common need.

Thanks!

© Server Fault or respective owner

Related posts about php

Related posts about postfix