a collection of miscellaneous projects of Paul Philippov

Exim Useful Tips

Please note, I use in examples. You might want to replace it with your own domain.

How to generate self-signed certificate for Exim4

$ sudo /usr/share/doc/exim4-base/examples/exim-gencert

How to check DKIM and SPF records for your domain

or send an email to

How to disable IPv6 in Exim4 on Debian

# disable IPv6
disable_ipv6 = true
dns_ipv4_lookup = *

add this to the beginning of /etc/exim4/conf.d/main/01_exim4-config_listmacrosdefs, update configuration, and restart the service.

How to serve direct delivery for a particular domain along with a smarthost for rest

  condition = ${if eq {${lc:$domain}} {} {true} fail }
  driver = dnslookup
  transport = remote_smtp


  condition = ${if eq {${lc:$domain}} {} {true} fail }
  driver = manualroute
  transport = remote_smtp
  route_list = "* byname"

add this to /etc/exim4/conf.d/router/200_exim4-config_primary before smarthost entry.

How to check routing

# exim -bt -d

How to resend frozen messages in exim4 queue

# exim -bp | grep frozen | awk '{print $3}' | xargs exim -v -M

How to remove a message from queue

# exim -Mrm {message-id}

How to debug Exim SMTP on a production server

Start Exim in debug mode

# exim -bd -d -oX 26

then in another terminal send an email

# swaks --to --server localhost --port 26

(found at GuruBob's Blog)

How to check for TLS

# swaks -a -tls -q HELO -s -au test -ap '<>'

How to fix Unrouteable address for a local domain with Gmail smarthost

Add your domain name and corresponding smtp server to the list of hubbed hosts

# echo '' >> /etc/exim4/hubbed_hosts

then change hubbed transport to smarthost to have SMTP AUTH

# sed -i 's/transport = remote_smtp/transport = remote_smtp_smarthost/' \

(from Exim mail list)