Sending mail using mailjet smarthost

Problem Description

Please can you help me set up exim to use the mailjet smart host to send email. It gives the error messages below with no mail being sent. On another gcloud instance it was working with postfix.
Mail is being sent from my phpbb forum using Brevo on port 587 so the firewall should be open.

telnet to mailjet smtp server on 587 works as well so it should be able to get to the mailjet server.

dig in-v3.mailjet.com

telnet 34.22.188.249 587

Mail is received from external and internal users into the sympl mailboxes and so all the DNS checks out with SPF, DKIM and DMARK.

I have first tried

dpkg-reconfigure exim4-config

but could not get that to work

then did this

nano /etc/exim4/exim4.conf.template

‘begin authenticators’

auth_login:

driver = plaintext
public_name = LOGIN
client_send = :APIkey :Secretkey

under ‘begin routers ’

smart_route:
driver = manualroute
domains = ! +local_domains
ignore_target_hosts = 127.0.0.0/8
transport = auth_relay
route_list = * in-v3.mailjet.com:587
no_more

Under ‘begin transports’

auth_relay:
driver = smtpport = 587
hosts_require_auth = $host_address
hosts_require_tls = $host_address

systemctl restart exim4.service

Any Error Messages

After

mail -s “Exim Test” myaddress@gmail.com < /dev/null

Null message body; hope that’s ok

2025-10-09 10:42:02 End queue run: pid=1068925
2025-10-09 10:44:36 1v6o8S-005LDO-1T <= sympl@jowettnet U=sympl P=local S=429
2025-10-09 10:44:36 1v6o8S-005LDO-1T ** test”@jowettnet <Test”@jowettnet>: Unrouteable address
2025-10-09 10:46:46 1v6o8S-005LDO-1T H=gmail-smtp-in.l.google.com [142.251.183.26]: SMTP timeout after initial connection: Connection timed out
2025-10-09 10:48:57 1v6o8S-005LDO-1T H=alt1.gmail-smtp-in.l.google.com [142.250.96.26]: SMTP timeout after initial connection: Connection timed out
2025-10-09 10:51:08 1v6o8S-005LDO-1T H=alt2.gmail-smtp-in.l.google.com [64.233.177.27]: SMTP timeout after initial connection: Connection timed out
2025-10-09 10:51:08 1v6o8S-005LDO-1T H=alt3.gmail-smtp-in.l.google.com [2607:f8b0:4023:2c03::1b] Network is unreachable
2025-10-09 10:51:10 1v6o8S-005LDO-1T == myaddress@gmail.com R=dnslookup T=remote_smtp defer (101): Network is unreachable H=alt2.gmail-smtp-in.l.google.com [64.233.177.27]
2025-10-09 10:51:10 1v6o8S-005LDO-1T ** myaddress@gmail.com: retry timeout exceeded
2025-10-09 10:51:10 1v6oEo-005pQ0-20 <= <> R=1v6o8S-005LDO-1T U=Debian-exim P=local S=1934
2025-10-09 10:51:10 1v6o8S-005LDO-1T Completed
2025-10-09 10:51:10 1v6oEo-005pQ0-20 ** sympl@jowettnet: Unrouteable address
2025-10-09 10:51:10 1v6oEo-005pQ0-20 Frozen (delivery error message)

Environment

  • Sympl Version: 12
  • Sympl Testing Version:
  • Debian Version:12
  • Hardware Type: Cloud instance
  • Hosted With: Google

Sympl isn’t designed to send mail via a smarthost, but its possible, usually with a configuration similar to what you have there.

However, your test seems to be sending mail from an invalid address (sympl@jowettnet) to another invalid address (test”@jowettnet), and your configuration seems to be trying to send mail via Gmail, which really doesn’t match the configuration.

As is, Sympl is mostly stock Debian, so regular Exim but with a more complicated configuration - if you want to make changes you’d need to do so in /etc/exim4/sympl.d and then run sudo make from /etc/exim4 to update the configuration.

Mailjet support should be able to help you from there.

Thanks. I did have a look at the files in sympl.d. Which one requires changing? I also tried sending a mail from the webmail user. Why it is sending via gmail needs some investigation! The system is a new build migrating from a Bitnami Debian 10 stack to the sympl stack which Peter Collinson recommended.

The (/etc/exim4) sudo make runs through the sympl.d files in alphanumeric order to generate /etc/exim4/exim.conf. So, to position a new router at the front of the queue you could add a new file like:

/etc/exim4/sympl.d/20-routers/02-smarthost-mailjet

Order is not significant for transports but you could use something similar:

/etc/exim4/sympl.d/30-transports/02-smarthost-mailjet

Just in case it’s not a forum display issue, the port separator needs double quoting:
route_list = * in-v3.mailjet.com::587

(And, I assume that last line was a copy/paste end-of-line glitch)

Thanks very much. It is now working!
This is what I did.
ADDING SMART HOST TO sympl.d

/etc/exim4/sympl.d/20-routers/02-smarthost-mailjet

#Added by KC
smart_route:
driver = manualroute
domains = ! +local_domains
ignore_target_hosts = 127.0.0.0/8
transport = auth_relay
route_list = * in-v3.mailjet.com::587
#NOTE there are two colons after mail server name

/etc/exim4/sympl.d/30-transports/02-smarthost-mailjet

#Added by KC
auth_relay:
driver = smtp
port = 587
hosts_require_auth = in-v3.mailjet.com
hosts_require_tls = in-v3.mailjet.com

/etc/exim4/sympl.d/60-authenticators/02-smarthost-mailjet

#Added by KC
auth_login:
driver = plaintext
public_name = LOGIN
#client_send = :APIKey :APISecret

The APIKey and APISecret are those created in my MailJet account . The leading # should be removed