From Setting up IMAP for Amazon WorkMail:
| Configuration | Value |
|---|---|
| Protocol | SMTPS (SMTP, encrypted with TLS) - not STARTTLS! |
| Port | 465 |
| Username | Amazon WorkMail account |
| Password | Amazon WorkMail password |
| Outgoing Server | smtp.mail.us-east-1.awsapps.com |
# create if needed
sudo vim /etc/postfix/sasl_passwd
# add username/password
[smtp.mail.us-east-1.awsapps.com]:465 [email protected]:CHANGEME
# lock down credentials
chmod 600 /etc/postfix/sasl_passwd
# update hash map - run after every change!
sudo postmap /etc/postfix/sasl_passwd
# reload
sudo postfix reload
# configure
sudo postconf relayhost='[smtp.mail.us-east-1.awsapps.com]:465'
sudo postconf smtp_sasl_auth_enable=yes
sudo postconf smtp_sasl_mechanism_filter=plain
sudo postconf smtp_sasl_password_maps=hash:/etc/postfix/sasl_passwd
sudo postconf smtp_tls_security_level=encrypt
sudo postconf smtp_tls_wrappermode=yes
sudo postconf smtp_use_tls=yes
sudo postfix reload
# send email
echo `date` | mail [email protected]
# check queue, it should be empty
mailq# check queue, more -v's give more output
mailq -v
# manually run (flush) queue
sudo postqueue -f
# delete all messages in queue
sudo postsuper -d ALL
# on Mac, check logs (run this, then run mail commands again, in another window)
log stream --predicate '(process == "smtpd") || (process == "smtp")' --info