(717) 288-7191

In this post we will see how we can configure some domains in the server to relay through the amazon ses service and other domains which we dont want to go through ses to send via the local exim MTA.

First create the file /etc/excludeindomains and add the domains which you dont want to route through ses.

The format should be :


Next create a file /etc/excludeoutdomains and add the same domains in the following format :


These 2 files are for both incoming and outgoing mails. 

Add the following line under the Section CONFIG ( you will see similar lines there )

domainlist exclude_receiver_domains = lsearch;/etc/excludeindomains 
domainlist exclude_sender_domains = lsearch;/etc/excludeoutdomains

Next add the following lines in Section: ROUTERSTART

You need to write this in the section which we mention about the ses relaying. ( after the ” begin routers ” line )

domains = !+exclude_receiver_domains: !+local_domains 
senders = !*@+exclude_sender_domains

Rest you can follow in this documentation :


Just make sure you dont overwrite the ‘domains’ thing mentioned above as ‘domains = ! +local_domains’ as given in aws doc. This should not be domains = ! +local_domains if you want domains which should not route through ses. It should rather be as ( as mentioned above )

domains = !+exclude_receiver_domains: !+local_domains
senders = !*@+exclude_sender_domains

That’s it, wait a min though, dont forget to restart your exim 😉

Need any help in AWS or cPanel ? Contact our K9 response on-demand assistance