HELO problem with IPv6

dicktump

Verified User
Joined
Dec 10, 2008
Messages
24
Location
Enschede, NL
We have upgraded several servers to exim.conf version 4.4.2 from old exim.conf versions (mostly 2.x). Since the upgrade, users are reporting that they can't send email from Roundcube.

This is the error from Exim: Bad HELO - Host impersonating hostname

All our servers have IPv6 and it seems that IPv6 together with the new exim.conf does not work:

Code:
[root@da7 custombuild]# telnet localhost 25
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 da7.cloud.shockmedia.nl ESMTP Exim 4.86.2 Wed, 01 Jun 2016 14:56:37 +0200
HELO da7.cloud.shockmedia.nl
550 Bad HELO - Host impersonating hostname [da7.cloud.shockmedia.nl]

Code:
[root@da7 custombuild]# telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 da7.cloud.shockmedia.nl ESMTP Exim 4.86.2 Wed, 01 Jun 2016 15:03:27 +0200
HELO da7.cloud.shockmedia.nl
250 da7.cloud.shockmedia.nl Hello localhost [127.0.0.1]

Servers with IPv6 try to connect over the IPv6 localhost :):1) by default, so that explains why Roundcube has this problem.

I have done a quick (but very ugly) fix by removing the following lines from exim.conf:

Code:
  # deny if the HELO pretends to be this host
    deny message = HELO_HOST_IMPERSANATION
      condition = ${if or { \
                            {eq{$sender_helo_name}{$smtp_active_hostname}} \
                            {eq{$sender_helo_name}{[$interface_address]}} \
                          } {true}{false} }

and

Code:
deny message = HELO_IS_LOCAL_DOMAIN
        condition = ${if match_domain{$sender_helo_name}{+local_domains}{true}{false}}
        hosts = ! +relay_hosts

Is this a bug in the Exim configuration, or is there something else wrong with the configuration?
 
What about your /etc/hosts file?

Usually localhost should point to 127.0.0.1 and localhost6 to ::1

Can you check that?

Regards
 
This is the /etc/hosts file - it is the default file generated by the CentOS installation and has not been changed since then:

Code:
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
31.7.7.98               da7.cloud.shockmedia.nl
 
I guess that's the problem.

Quite courios that is the default one

Change it to:

Code:
127.0.0.1   localhost
::1         localhost6
31.7.7.98   da7.cloud.shockmedia.nl

And try again.

Regards
 
I don't think that's the best solution. The host 'localhost' should point to both IPv4 and IPv6 localhost addresses, because localhost4 and localhost6 are used to force IPv4 or IPv6 connections. I have checked several servers and this /etc/hosts file is the default on both CentOS 6 and CentOS 7. It's better to have this fixed in the Roundcube configuration (change the SMTP server to localhost4) or even better, to change the Exim configuration that connections from ::1 are also accepted. Roundcube possibly isn't the only application, other software (such as newsletter software from our clients) could also use localhost as SMTP server.

RFC 6761 #6.3 also suggests that lookups for 'localhost' on IPv4 should point to the IPv4 address and lookups on IPv6 should point to the IPv6 address, which would not be the case if we configure just the IPv4 address for localhost: https://tools.ietf.org/html/rfc6761#section-6.3
 
I dont see the point but ok.

Anyway exim.conf from DA does work with IPv6

Code:
>telnet ::1 25
Trying ::1...
Connected to ::1.
Escape character is '^]'.
220 Service01.CrazyNetwork.it ESMTP Exim 4.87 Fri, 10 Jun 2016 15:22:20 +0200
HELO Service01.CrazyNetwork.it
250 Service01.CrazyNetwork.it Hello Service01.CrazyNetwork.it [::1]

Code:
# SpamBlockerTechnology* powered exim.conf, Version 4.4.2
# Dec 5, 2015
# Exim configuration file for DirectAdmin
# Requires exim.pl as distributed by DirectAdmin here:

Can you confirm that your /etc/exim.pl is version 21?

PS: The fact you connect on IPv4 locally wouldn't prevent exim to communicate over IPv6 with external server, so the application shouldn't really bother to use IPv4 or IPv6 locally.
PSS: You should consider to update your exim version! :)

Regards
 
Last edited:
Back
Top