Menu
Amazon Simple Email Service
Developer Guide

Integrating Amazon SES with Exim

Exim is an MTA that was originally developed for Unix-like systems. It is a general purpose mail program that is very flexible and configurable.

To learn more about Exim, go to http://www.exim.org.

To configure integration with the Amazon SES US West (Oregon) endpoint using STARTTLS

  1. Open the /etc/exim/exim.conf file for editing. If the file does not exist, create it.

    Important

    These instructions assume that you want to use Amazon SES in the US West (Oregon) AWS Region. If you want to use a different region, replace all instances of email-smtp.us-west-2.amazonaws.com in these instructions with the SMTP endpoint of the desired region. For a list of SMTP endpoints, see Regions and Amazon SES.

  2. In /etc/exim/exim.conf, make the following changes:

    1. In the routers section, after the begin routers line, add the following:

      Copy
      send_via_ses: driver = manualroute domains = ! +local_domains transport = ses_smtp route_list = * email-smtp.us-west-2.amazonaws.com;
    2. In the transports section, after the begin transports line, add the following:

      Copy
      ses_smtp: driver = smtp port = 25 hosts_require_auth = $host_address hosts_require_tls = $host_address
    3. In the authenticators section, after the begin authenticators line, add the following, replacing USERNAME and PASSWORD with your SMTP user name and password:

      Important

      Use your SMTP user name and password, not your AWS access key ID and secret access key. Your SMTP credentials and your AWS credentials are not the same. For information about how to obtain your SMTP credentials, see Obtaining Your Amazon SES SMTP Credentials.

      Copy
      ses_login: driver = plaintext public_name = LOGIN client_send = : USERNAME : PASSWORD
  3. Save the /etc/exim/exim.conf file.

To configure integration using a secure tunnel

  1. To begin, you will need to set up a secure tunnel as described in Secure Tunnel. In the following procedure, we use port 2525 as your stunnel port. If you are using a different port, modify the settings that you actually use accordingly.

  2. Open the /etc/exim/exim.conf file for editing. If the file does not exist, create it.

    Important

    These instructions assume that you want to use Amazon SES in the US West (Oregon) AWS Region. If you want to use a different region, replace all instances of email-smtp.us-west-2.amazonaws.com in these instructions with the SMTP endpoint of the desired region. For a list of SMTP endpoints, see Regions and Amazon SES.

  3. In /etc/exim/exim.conf, make the following changes:

    1. In the routers section, after the begin routers line, add the following:

      Copy
      send_via_ses: driver = manualroute domains = ! +local_domains transport = ses_smtp self = send route_list = * localhost
    2. In the transports section, after the begin transports line, add the following:

      Copy
      ses_smtp: driver = smtp port = 2525 hosts_require_auth = localhost hosts_avoid_tls = localhost
    3. In the authenticators section, after the begin authenticators line, add the following, replacing USERNAME and PASSWORD with your SMTP user name and password:

      Copy
      ses_login: driver = plaintext public_name = LOGIN client_send = : USERNAME : PASSWORD
  4. Save the /etc/exim/exim.conf file.

When you have finished updating the configuration, restart Exim. At the command line, type the following command and press ENTER.

sudo /etc/init.d/exim restart

Note

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

When you have completed this procedure, your outgoing email will be sent via Amazon SES. To test your configuration, send an email message through your Exim 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/exim/main.log file.