Amazon Simple Email Service
Developer Guide (API Version 2010-12-01)
Print this pageEmail this pageGo to the ForumsView the PDFShare this page on TwitterShare this page on FacebookBookmark this page on DeliciousSubmit this page to RedditSubmit this page to DiggDid this page help you?  Yes  No   Tell us about it...

Integrating Amazon SES with Sendmail

To integrate ses-send-email.pl with Sendmail

  1. On your mail server, open the sendmail.cf file. On many systems, this file resides in the /etc/mail directory.

  2. Configure a new mailer: Add the following line to the file, modifying it to reflect your particular situation:

    Maws-email,         P=/opt/third-party/amazon/ses-send-email.pl, F=mDFMuXn, U=mailuser, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, A=ses-send-email.pl -r -k /opt/third-party/amazon/aws-credentials -e   https://email.us-east-1.amazonaws.com   -f $f $u

    Note the following about this example:

    • The U parameter must specify a non-root user (i.e., a nonadministrative user). The user "mailuser" is for illustrative purposes only.

    • The ses-send-email.pl script and the credentials file reside in the /opt/third-party/amazon directory.

    • The endpoint for communicating with Amazon SES is https://email.us-east-1.amazonaws.com.

    You should modify these parameters as appropriate.

  3. Verify that the mailertable feature is enabled. Look for the following line:

    FEATURE(`mailertable')dnl

    If this line does not exist, you will need to add it.

  4. Save sendmail.cf.

  5. Open the mailertable file. On many systems, this file resides in the /etc/mail directory. If the file does not exist, create it.

  6. Add the following line to send all email using the aws-email mailer:

    .<TAB>aws-email:%0
    [Note]Note

    Replace <TAB> with an actual TAB character.

  7. Build the mailertable database.

    makemap hash /etc/mail/mailertable < /etc/mail/mailertable

  8. To verify your configuration, generate a deliverability report:

    sendmail -bv user@example.com

  9. In this report, look for the following output:

    user@example.com... deliverable: mailer awsemail, host example.com, user user@example.com
  10. Restart Sendmail. At the command line, type the following command and press ENTER.

    sudo /etc/init.d/sendmail restart

[Tip]Tip

If you encounter errors when restarting Sendmail, you can restart Sendmail in debug mode:

sudo /etc/init.d/sendmail restart -bD -O LogLevel=20 -X /tmp/sendmail.log

From this point on, your outgoing email is sent via Amazon SES. To test your configuration, send an email message through your Sendmail server, and then verify that arrives at its destination. If the message is not delivered, then check your system's mail log for errors. On many systems, this is the /var/log/mail.log file.

[Tip]Tip

If your mail does not arrive, look in the mail log for the following error:

Can't locate SES.pm in @INC

This message indicates that the SES.pm Perl module does not exist or cannot be found on your system. For more information, refer to the README file that comes with the Amazon SES scripts.