We have failing SMTP requests because our port 25 was closed on our EC2 instances. These are the steps that you might want to follow in order to fix the SMTP issues and to be able to send email again.
You can look here for the docs that I followed to figure out the path forward.
- SSH into the lightsail instance
- Create a new file so that you can easily change text/spacing/etc
- The file content:
#!/bin/bash sudo postconf -e "relayhost = [email-smtp.us-east-1.amazonaws.com]:587" \ "smtp_sasl_auth_enable = yes" \ "smtp_sasl_security_options = noanonymous" \ "smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd" \ "smtp_use_tls = yes" \ "smtp_tls_security_level = encrypt" \ "smtp_tls_note_starttls_offer = yes"
- Edit the password:
sudo vim /etc/postfix/sasl_passwd- Should look like this
[email-smtp.us-east-1.amazonaws.com]:587 SMTPUSERNAME:SMTPPASSWORD - Create a new SMTP user on AWS or ask @Tim for the root
- Should look like this
- Hashmap the new creds
sudo postmap hash:/etc/postfix/sasl_passwd - Change ownership and permissions
sudo chown root:root /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.dbsudo chmod 0600 /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db
- Restart
postfix:sudo service postfix restart - Send a test email:
- You will enter the following line by line, pressing
enterorcarriage returnafter each - Be sure to replace
testemail@testmail.comwith whatever email you want to send the test to
sendmail -f dev@gobigwheel.com testemail@testemail.com From: Sender Name dev@gobigwheel.com Reply-To: dev@gobigwheel.com Subject: Amazon SES test mail test mail form ses. .- Note: the last
.is important. It tells the computer that you are done - NOTE: You might have to do
"Sender Name" <dev@gobigwheel.com>in theFrom:header. Try without and if that gives you5xxerrors in the log aboutSender@ipandName@ipnot working, you will need to try the different format
- You will enter the following line by line, pressing