EasySMTP

Sample Exim configuration for SMTP Email

To begin, locate your system's Exim configuration files. In most distributions these will be in /etc/exim, if not try 'locate exim.conf'.

By default, Exim does not include a password or access file. In this example, we'll create our own file at /etc/exim/access. Entries in this file should follow the format of 'key: auth_name=username auth_pass=secret auth_plain=^username^secret'.

Add an entry to the access file for Easy-SMTP. Remember to replace the accountid, user, and password with your own authentication details.

$ echo "easysmtp_auth: auth_name=ACCOUNTID\user auth_pass=password auth_plain=^ACCOUNTID\user^password" >> /etc/exim/access
$ chown root:root /etc/exim/access
$ chmod 600 /etc/exim/access

Add the following to /etc/exim/exim.conf.

...
MAIN_TLS_ENABLE = 1
...

Add the following to the Exim routers in /etc/exim/exim.conf.

...
outgoing:
       driver = manualroute
       domains = !+local_domains
       route_list = * ssrs.reachmail.net 
       transport = easy_smtp_relay
...

Add the following to the Exim transports in /etc/exim/exim.conf.

...
easy_smtp_relay:
        driver = smtp 
        hosts_require_tls = ssrs.reachmail.net
        hosts_try_auth = easysmtp_auth 
        tls_require_ciphers = SSLv3+TLSv1
...

Add the following to the authenticator configuration. Autheticators may or may not be configured by default in your Exim installation. If not, make sure to include the 'begin authenticators' line before the authenticators in the config file.

...
plain:
        driver = plaintext
        public_name = PLAIN
        client_send = "${extract{auth_plain}{${lookup{$host}lsearch{/etc/exim/access}{$value}fail} }}"
...

Restart exim. Note that your command to restart exim may be different

$ /sbin/service exim restart

 

Special Configurations

Route specific domains through Easy-SMTP

If you want to route only certain domains through Easy-SMTP, the easiest solution is to change the route_list variable in the smart host router. In this example, the route_list will be defined by a file at /etc/exim/esroutes with entries formatted as “domain relay-host”.

Add the domain relay definitions to /etc/exim/esroutes

$ echo "some-domain.tld ssrs.reachmail.net" >> /etc/exim/esroutes
$ echo "some-other-domain.tld ssrs.reachmail.net" >> /etc/exim/esroutes
$ chown root:root /etc/exim/esroutes
$ chmod 600 /etc/exim/esroutes

Change the route_list variable in the smart_host_relay router of /etc/exim/exim.conf

...
route_list = /etc/exim/esroutes
...

Restart Exim. Note that your command to restart Exim may be different.

$ /sbin/service exim restart