简体   繁体   中英

How to configure OpenSMTPD with Amazon SES?

Amazon提供了有关postfix和sendmail的说明,但没有OpenSMTPD的说明 ,因此请在此处添加说明。

Tested with OpenBSD 5.8

  1. Verify your domain and a sender in AWS SES console . Save your SMTP Settings.

  2. Set up the SMTP authentication details in the mail secrets database (replacing $smtpUsername:$smtpPassword with the values from step 1)

     # touch /etc/mail/secrets # chmod 640 /etc/mail/secrets # chown root:_smtpd /etc/mail/secrets # echo "ses $smtpUsername:$smtpPassword" >> /etc/mail/secrets # makemap /etc/mail/secrets 
  3. Configure OpenSMTPD:

     # nano /etc/mail/smtpd.conf listen on lo0 table aliases db:/etc/mail/aliases.db table secrets db:/etc/mail/secrets.db accept for local alias <aliases> deliver to mbox accept from local for any relay via tls+auth://ses@email-smtp.us-east-1.amazonaws.com auth <secrets> 
  4. Restart OpenSMTPD:

     # rcctl restart smtpd 
  5. Test it:

     # sendmail -v -f verified-sender@verified-domain.com to@example.com Subject: test subject test body ^D 

Errors?

watch your line-breaks in smtpd.conf

# smtpd -n to check for syntax errors in smtpd.conf

Try port 587 if your machine is blocking port 25 (add :587 to end of aws url in smtpd.conf )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM