Exim, IPv6, and lots of email errors

Since I eventually moved the email server (exim) over to the server blastoise, it’s been giving me grief. Something along the lines of rejecting emails because it wasn’t allowed to relay mail through itself, even though I’d actually told that it was allowed to:

hostlist   relay_from_hosts = <; localhost ; 178.79.130.8

However, blastoise is IPv6 capable, and prefers that over IPv4, and because all the settings point to "mail.helpmebot.org.uk" which points to both 178.79.130.8 and 2001:470:1f09:1213::2, it was skipping "localhost", and preferring IPv6, which wasn't listed, hence the nice error log was filling up with messages like this:

220 helpmebot.org.uk ESMTP Exim 4.71 Sat, 19 Feb 2011 17:50:24 +0000
EHLO blastoise.helpmebot.org.uk
250-helpmebot.org.uk Hello blastoise.helpmebot.org.uk [2001:470:1f09:1213::2]
MAIL FROM:
250 OK
RCPT TO:
550 relay not permitted

Hopefully the problem is fixed now, with the correct configuration (adding the brand new metapod's IPv4 and IPv6 addresses):

hostlist   relay_from_hosts = <; localhost ; 178.79.130.8 ; 178.79.155.110 ; 2001:470:1f09:1213::2 ; 2001:470:1f09:1581::2

In case you were wondering, the default separator for lists in Exim's config file is :, which causes "issues" with IPv6 addresses. A quick google told me to prepend <; to the beginning of the list, which changes the separator from : to ;, which doesn't cause a problem with IPv6 addresses. :)

Sometimes I really don't like it when that sort of thing happens... configuration stuck in a dark dusty corner somewhere breaks because something random changes like adding an IP to the system.

One thought on “Exim, IPv6, and lots of email errors

  1. Instead of using ;, you can also double up your : separators, so “2001:470:1f09:1213::2” in the example above would become “2001::470::1f09::1213::::2”

Comments are closed.