Ubuntu Postfix Tips with aMiSTACX and AWS

AWS EC2 Postfix Email Configuration Tips

Although the Postfix sendmail function will work out of the box on aMiSTACX, here are some tips in case you run into issues.

    1. Set the main.cnf to IP4 for the interface protocol
      sudo nano /etc/postfix/main.cf
      inet_protocols = ipv4
    2. Make sure your hostname is the name of your domain. e.g. example.com
      sudo nano /etc/hostname
    3. Set the main.cf mydomain parameter to your hostname e.g. ~ Line 35: myhostname = example.com
    4. Remove AWS DNS name from ~ Line 39: mydestination = $myhostname, ip-172-30-0-139.ec2.internal, localhost.ec2.internal, , localhost
    5. Restart Postfix after any changes:
      sudo service postfix restart
    6. Make sure external DNS is configured correctly with any PNTR or SPF records
    7. Make sure outbound TCP Port 25 is open. [Sendmail’s Default and SMTP’s Default]
    8. Make sure no AWS restrictions on EMAIL.
    9. Quick test from CLI:
      echo "Subject: sendmail test" | sendmail -v [email protected]~ Lead_Robot

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 message queue: sudo postsuper -d ALL

Comments are closed.