themactep

a collection of miscellaneous projects of Paul Philippov

Exim Useful Tips

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

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

or

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

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

How to check routing

$ sudo exim -bt <remote address>

How to resend frozen messages in exim4 queue

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

How to remove a message from queue

$ sudo -s
# exim -Mrm {message-id}
# exit