Setup with exim

Install exim and dependencies

Run the following to ensure that exim and all necessary dependencies are installed:

apt-get update
apt-get -y install exim4

Edit /etc/exim4/update-exim4.conf.conf

Edit /etc/exim4/update-exim4.conf.conf (yes, two .confs at the end!) and change the following lines (there will be other config in between these lines):


Save and exit Update /etc/exim4/update-exim4.conf.conf.

Edit /etc/exim4/passwd.client

Edit /etc/exim4/passwd.client, and add the following at the bottom of the file, where YourUsername and YourPassword match those provided to you:

### BEGIN Add content for
### END Add content for

Save and exit /etc/exim4/passwd.client.

Add authentication header

It's necessary for exim to pass a special header to our MTA, to ensure your email is correctly authenticated. Edit /etc/exim4/conf.d/transport/30_exim4-config_remote_smtp_smarthost, search for a line reading:

driver = smtp

Add the following below this line:

dnl #### BEGIN Add header for
headers_add = X-AuthUser: $authenticated_id 
dnl #### END Add header for

Save and exit /etc/exim4/conf.d/transport/30_exim4-config_remote_smtp_smarthost.

Apply config

Apply your updated config, by running:


Restart exim

Run /etc/init.d/exim4 reload to restart exim

Send test email

From the command line, you can send a test email to yourself, by running the following (replacing <your-email-address> with a real one):

echo "Hello, I am your test" | mail -r <your-email-address> -s "Test email via" <your-email-address>

Check the contents of /var/log/exim4/mainlog to confirm successful delivery

Here's an example of what a successful email delivery might look like:

2019-03-23 00:23:02 1h7URA-0001LA-Bg => R=smarthost T=remote_smtp_smarthost [] X=TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256 CV=no DN=",C=AU,ST=Some-State,O=Internet Widgits Pty Ltd" A=plain C="250 2.0.0 Ok: queued as d1b94395-4d01-11e9-9a10-d1cb19a74d67"
2019-03-23 00:23:02 1h7URA-0001LA-Bg Completed