Exim 4

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:


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

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


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

Note that you must use an API key to authenticate. Do this by setting your username to 'apikey' and your password to your API key's actual value (the string provided by Twilio SendGrid when you created the key).


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

$ /etc/init.d/exim4 restart


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 in the AUTH Box:

begin authenticators

  driver = plaintext
  public_name = LOGIN
  client_send = : apikey : <YourAPIKey>

Only include "begin authenticators" if it's not already in the configuration.

Add a route in the Router Configuration Box:

  driver = manualroute
  domains = ! +local_domains
  transport = sendgrid_smtp
  route_list = "* smtp.sendgrid.net::587 byname"
  host_find_failed = defer

Add a transport to the Transport Configuration Box:

  driver = smtp
  hosts = smtp.sendgrid.net
  hosts_require_auth = <; $host_address
  hosts_require_tls = <; $host_address

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

$ /etc/init.d/exim4 restart

Exim Documentation

If your version of Exim does not match the version above or you are not finding the answer you need, please check out the Official Exim Documentation for more information.

Rate this page:

Need some help?

We all do sometimes. Get help now from the Twilio SendGrid Support Team.

Running into a coding hurdle? Lean on the wisdom of the crowd by browsing the SendGrid tag on Stack Overflow or visiting Twilio's Stack Overflow Collective.

Thank you for your feedback!

Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

Sending your feedback...
🎉 Thank you for your feedback!
Something went wrong. Please try again.

Thanks for your feedback!

Refer us and get $10 in 3 simple steps!

Step 1

Get link

Get a free personal referral link here

Step 2

Give $10

Your user signs up and upgrade using link

Step 3

Get $10

1,250 free SMSes
OR 1,000 free voice mins
OR 12,000 chats
OR more