Versions of Exim prior to the current major release are considered obsolete. If you are using Exim 3.x or earlier it is suggested by the Exim development team that you upgrade to the current release.

The following configuration file, which can be found at /etc/exim4/update-exim4.conf.conf, was pulled from Ubuntu Server 10.4 and is for example purposes only:

1
2
3
4
5
6
7
8
9
10
11
12
dc_eximconfig_configtype='smarthost'
dc_other_hostnames=''
dc_local_interfaces='127.0.0.1'
dc_readhost='your.server.name'
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost='smtp.sendgrid.net::587'
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname='true'
dc_mailname_in_oh='true'

Enable TLS support in /etc/exim4/exim4.conf.localmacros.


If this file does not exist, you will need to create it:
1
MAIN_TLS_ENABLE = 1

Enter credentials that will allow Exim to access SendGrid inĀ /etc/exim4/passwd.client:

1
*:sendgridusername:sendgridpassword

Once you have completed and saved all changes to Exim’s configuration files, you will need to restart it to activate those changes:

1
$ /etc/init.d/exim4 restart

cPanel

If you are using cPanel with Exim and want to relay your email through SendGrid, go to Main > Service Configuration > Exim Configuration Editor, click on the Advanced Editor button, and enter the following:

1
2
3
4
5
6
begin authenticators

sendgrid_login:
  driver = plaintext
  public_name = LOGIN
  client_send = : username@example.com : YourSendGridPassword
Only include “begin authenticators” if it’s not already in the configuration.

Add a route in the Router Configuration Box:

1
2
3
4
5
6
7
send_via_sendgrid:
  driver = manualroute
  domains = ! +local_domains
  transport = sendgrid_smtp
  route_list = "* smtp.sendgrid.net::587 byname"
  host_find_failed = defer
  no_more

Add a transport to the Transport Configuration Box:

1
2
3
4
5
sendgrid_smtp:
  driver = smtp
  hosts = smtp.sendgrid.net
  hosts_require_auth = smtp.sendgrid.net
  hosts_require_tls = smtp.sendgrid.net

Once you have completed and saved all changes to Exim’s configuration files, you will need to restart it to activate those changes:

1
$ /etc/init.d/exim4 restart