This is a guide on how we can setup our own SMTP server for sending lots of emails.
- Why take the pain? It is 100x cheaper and scalable.
- Finding a good host
- Setting up postfix
- Monitoring
- Sending test emails and getting verified[./production.md]
- Check if SPF and DKIM tests are passing
- Monitor server health using Google's Postmaster and Outlook's SNDS
- Script to get daily error logs
- Whitelisting
- Check on common services
- Whitelist on Hotmail
- Useful commands for debugging or handling send queue
-
Choose a host which provides reverse DNS and whitelisted IPs: choosing host
-
Start a new virtual server: use FQDN (eg
mail.domain.com
) as hostname. -
Assign Elastic IP as they are negotiated for whitelisting.
-
Check Server IP Quality on spam tracking services: IP status
-
Open a support ticket with your host to allow SMTP.
-
Enable firewall: server setup
-
Install postfix on server: installing postfix
-
Send a test mail from SMTP server
-
Send a test mail from another machine using authentication
-
Fine tune installation
-
Setup SPF DNS record
-
Setup DKIM DNS record
-
Setup PTR record (reverse DNS): done at host level: check status here
-
Send a test mail to see results:
echo "Testing" | mail -aReply-To:your.email@gmail.com -s "Testing Mail" check-auth@verifier.port25.com
-
Setup Google Postmaster account to debug mail quality
-
Subscribe to JMRP: https://kb.iweb.com/hc/en-us/articles/230267648-Subscribing-to-Microsoft-JMRP-and-SNDS