How to configure HestiaCP / Exim 4 for SMTP Relay (SendGrid, Mailgun, Amazon SES, etc)

I’ve figured this out for mailjet. You probably want to be editing exim4.conf.template

Under ‘begin authenticators’ I added

mailjet_login:
  driver = plaintext
  public_name = LOGIN
  client_send =:apiuser:apikey

Under ‘begin routers’ I added

 send_via_mailjet:
   driver = manualroute
   domains = ! +local_domains
   transport = mailjet_smtp
   route_list = * in-v3.mailjet.com

// This sends all non-local domains through mailjet. You can add specific domains if you want. The route_list is the name of the mailjet server I’m sending through.

Under ‘begin transports’ I have

mailjet_smtp:
  driver = smtp
  port = 587
  hosts_require_auth = *
  hosts_require_tls = *

That was pretty much it. Chang the port as neccessary. Put your real apiuser and apikey in between the colons

5 Likes