I want to test a Newsletter application on a dummy server but I don't want all the clients in my DB (dumped from the live server) to get an email. Is there any way to prevent sendmail from sending those mails really out and instead save them to a file or something similar?
Prevent sendmail from sending emails and instead save them to a file
sendmail
Best Answer
You can do something like this:
/etc/mail/users-to-test contains the usernames that we do not want them to receive email from the test server. This addition to Ruleset 2 discards all email directed to them, and it is assumed that the above ruleset is applied to the sendmail running in your test machine and not on the production server.
PS: tabs separate the left from the right hand side of the rules. tabs and not spaces, so do not copy-paste.