Although the Postfix sendmail function will work out-of-the-box on an aMiSTACX deployment, here are some tips in case you run into issues.
-
- Set the main.cnf to IP4 for the interface protocol
sudo nano /etc/postfix/main.cf
inet_protocols = ipv4 - Make sure your hostname is the name of your domain. e.g., example.com
sudo nano /etc/hostname
- Set the main.cf mydomain parameter to your hostname e.g. ~ Line 35: myhostname = example.com
- Remove AWS DNS name from ~ Line 39: mydestination = $myhostname, ip-172-30-0-139.ec2.internal, localhost.ec2.internal, , localhost
- Restart Postfix after any changes:
sudo service postfix restart
- Make sure external DNS is configured correctly with any PNTR or SPF records
- Make sure outbound TCP Port 25 is open. [Sendmail’s Default and SMTP’s Default]
- Make sure no AWS restrictions on EMAIL.
- Quick test from CLI:
echo "Subject: sendmail test" | sendmail -v my@email.com
- Set the main.cnf to IP4 for the interface protocol
Troubleshooting
Log files go to /var/log/mail.log and /var/mail/
If you don’t see verbose logs, set the /ect/mailname to your FQDN for the server. e.g., myserver.com
Then restart the postfix service
sudo service postfix restart
Tip: Clear the Postfix message queue: sudo postsuper -d ALL
Alternatives
Do you really need to send email on SMTP 25? Perhaps SMTPS [Secure] on 587 or 465 is a better alternative? For a CMS like Magento or WordPress there are many alternatives that are available for free, and come as a plugin and offer better end-to-end security.
~ Lead_Robot