How to send emails from some domains via a different exim router Print

  • 1

Sometimes you do want to use a SMTP service like Amazon SES, SMTP2GO, SendGrid, MailGun, PostMark, but their are many scenarios thinkable where you only want use it for some domains .

Create a file:

touch /etc/virtual/ses_domains
chown mail:mail /etc/virtual/ses_domains
chmod 644 /etc/virtual/ses_domains

nano /etc/
driver = plaintext
public_name = LOGIN
client_send = : yourkey : yourkey
nano /etc/exim.transports.pre.conf
driver = smtp
port = 587
hosts_require_auth = $host_address
hosts_require_tls = $host_address
nano /etc/exim.routers.pre.conf
driver = manualroute
domains = ! +local_domains
condition = ${if match_domain{$sender_address_domain}{+local_domains}}
transport = ses_smtp
route_list = *

Now restart exim:

service exim restart

And add the domains to /etc/virtual/ses_domains that you which to be sending via this router.

Was dit antwoord nuttig?

« Terug