I'm doing development for a webapp that sends emails out to users. I've typically used Argosoft Mail Server (Freeware) in a windows environment as an SMTP server in which I've enabled relay but shutdown actual delivery. This allow me to point my webapp to my local server, and am able to validate all emails that are sent out by looking at the outgoing queue. Additionally, to be 100% safe, I would put in a non-existant DNS server to use to ensure that if I ever accidentally enable delivery, the server would still not be able to look up any external addresses and deliver the mail.
Now that I am doing development on an OSX machine, I'm looking for a similar solution. By default, OSX comes with Postfix installed, so I figured I would just use that and configure it similarly. However, I cannot seem to find an option anywhere to disable all outgoing email. Essentially, I want to set up Postfix as an open relay server, but disable delivery of all email. I can then look at the outgoing queue and see if the email(s) are as expected.
Is there anyway to easily accomplish this? Or is there a better solution I can use?
Put All Out Going Email On Hold
In
main.cf
, put followingcheck_recipient_access
as first option ofsmtp_sender_restrictions
2Create
/etc/postfix/onhold
with following contentEverything will be put into hold queue, except email for example.com.
Base on postfix site, change
300 is default, which is 5min. Change it to 3600 will make it retry once per hour. You can try change it to 86400(24hr). I think that should give you enough time for testing and inspecting email contect.
I've been researching a similar question, it looks like postsuper -h ALL and postsuper -H ALL should work. http://www.postfix.org/postsuper.1.html