Integrating Amazon SES with Exim - Amazon Simple Email Service

Integrating Amazon SES with Exim

Exim is a mail transfer agent (MTA) that is highly flexible and configurable. To learn more about Exim, visit the Exim website.


Exim is a third-party application, and isn't developed or supported by Amazon Web Services. The procedures in this section are provided for informational purposes only, and are subject to change without notice.

To configure Exim to send email through Amazon SES
  1. In a text editor, open the file /etc/exim.conf.local. If the file doesn't exist, copy the template from /etc/exim4/exim4.conf.template.

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

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

      send_via_ses: driver = manualroute domains = ! +local_domains transport = ses_smtp route_list = *;

      In the preceding code, replace with the SMTP endpoint that you want to use to send the message. For more information, see Regions and Amazon SES.

    2. In the transports section, after the begin transports line, add the following:

      ses_smtp: driver = smtp port = 587 hosts_require_auth = * hosts_require_tls = *
    3. In the authenticators section, after the begin authenticators line, add the following:

      ses_login: driver = plaintext public_name = LOGIN client_send = : USERNAME : PASSWORD

      In the preceding code, replace USERNAME with your SMTP user name, and PASSWORD with your SMTP password.


      Your SMTP credentials are not the same as your AWS Access Key ID and Secret Access Key. For information about obtaining your SMTP credentials, see Obtaining Amazon SES SMTP credentials.

  3. Save /etc/exim.conf.local.

  4. When you finish updating the configuration, enter the following command to restart Exim.

    sudo /etc/init.d/exim4 restart

    This command might differ depending on which operating system you use.

  5. At the command line, complete the following steps to send a test message:

    1. Enter the following command:

      exim -v

      In the preceding command, replace with the address that you want to send the message to.

    2. Enter the following, pressing Enter at the end of each line:

      From: Subject: Test message This is a test. .

      In the preceding command, replace with the address that you want to send the message from.

      When you press Enter after the final period (.), Exim begins the conversation with the SMTP server. If the connection remains open after the message is sent, press Ctrl+D to close it.


      If the message isn't delivered, check your system's mail log for errors. The Exim mail log is usually located at /var/log/exim4/mainlog.