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 Postfix

To integrate ses-send-email.pl with Postfix

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

  2. Configure a new mail transport: Add the following two lines to the master.cf file, modifying them to reflect your particular situation, and then save the file.

    aws-email  unix  -       n       n       -       -       pipe
      flags=R user=mailuser argv=/opt/third-party/amazon/ses-send-email.pl -r -k /opt/third-party/amazon/aws-credentials -e https://email.us-east-1.amazonaws.com -f ${sender} ${recipient}

    Note the following about these lines:

    • The flags line begins with at least one space.

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

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

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

  3. Open the main.cf file in the same directory as master.cf.

  4. Look for the default_transport line. If it exists, modify it as follows. If it doesn't exist, add the following line.

    default_transport = aws-email
  5. When you are done, save the file.

  6. Restart Postfix. At the command line, type the following command and press ENTER.

    sudo /etc/init.d/postfix restart

    [Note]Note

    This command may not be exactly the same on your particular server.

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