Skip to content

Instantly share code, notes, and snippets.

@johnou
Created August 13, 2021 09:35
Show Gist options
  • Save johnou/7786c91a0ed3df1ee7399fb005441b42 to your computer and use it in GitHub Desktop.
Save johnou/7786c91a0ed3df1ee7399fb005441b42 to your computer and use it in GitHub Desktop.
Sparkpost SMTP relay exim configuration
Host smtp.eu.sparkpostmail.com
Port 587
Alternative Port 2525
Authentication AUTH LOGIN
Encryption STARTTLS
Username SMTP_Injection
Password The password is an API key with Send via SMTP permissions.
Open /etc/exim4/exim4.conf.template and find the following sections:
begin routers
Below it, add these lines:
send_via_sparkpost:
driver = manualroute
domains = ! +local_domains
transport = sparkpost_smtp
route_list = * smtp.eu.sparkpostmail.com
no_more
If you have any other smarthost defined with "domains = ! +local_domains" remove that smarthost.
Continue to the next section:
begin authenticators
Below it, add these lines:
sparkpost_login:
driver = plaintext
public_name = LOGIN
client_send = : SMTP_Injection : api_key
Make sure you have no other authenticators with the same public_name (LOGIN).
Continue to the next section:
begin transports
Below it, add these lines:
sparkpost_smtp:
driver = smtp
port = 587
hosts_require_auth = $host_address
hosts_require_tls = $host_address
Run the command update-exim4.conf and restart exim /etc/init.d/exim4 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment