Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 379113 - mail-mta/exim-4.76 does not understand IPv6
Summary: mail-mta/exim-4.76 does not understand IPv6
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major
Assignee: Fabian Groffen
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-14 00:31 UTC by DEMAINE Benoît-Pierre, aka DoubleHP
Modified: 2012-10-09 18:06 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/tmp/emerge--info (emerge--info,18.56 KB, text/plain)
2011-08-14 00:31 UTC, DEMAINE Benoît-Pierre, aka DoubleHP
Details
/tmp/mail-mta:exim-4.76:20110813-235409.log (mail-mta:exim-4.76:20110813-235409.log,39.62 KB, text/plain)
2011-08-14 00:34 UTC, DEMAINE Benoît-Pierre, aka DoubleHP
Details
/tmp/exim.com (exim.com,2.92 KB, text/plain)
2011-08-15 15:51 UTC, DEMAINE Benoît-Pierre, aka DoubleHP
Details

Note You need to log in before you can comment on or make changes to this bug.
Description DEMAINE Benoît-Pierre, aka DoubleHP 2011-08-14 00:31:03 UTC
in a nutshell: 

Syslogs: 
Aug 14 02:11:44 uranus exim[27361]: 2011-08-14 02:11:44 1QsOIq-00077H-9M no IP address found for host 2a00

dhp@uranus ~ $ dig -t ANY smtp.gmail.com | grep -v -e "^;" -e "^$"
smtp.gmail.com.         89      IN      CNAME   gmail-smtp-msa.l.google.com.
gmail-smtp-msa.l.google.com. 600 IN     AAAA    2a00:1450:8002::6d
gmail-smtp-msa.l.google.com. 600 IN     A       209.85.227.108
gmail-smtp-msa.l.google.com. 600 IN     A       209.85.227.109
dhp@uranus ~ $

When there is an IPv6 capable DNS server in /etc/resolv.conf ... delivery is completely impossible.

***

My server had not been modified for over a year; configured eatly 2010, untouched since then. Exim is configured as proxy, to an other proxy: local users send outgoint messages to localhost (uranus), uranus then forwards messages to Gmail (smart proxy), who does the real delivery to target.

There are several illustration cases. Let start by capabilities: when I fill resolv.conf with v6 DNS server first (v6 IP for DNS), then v4, I can fully browse the web in either modes. WhatismyIP can detect both layers => my desktop is fully v6 compliant.

case 1: 8.8.8.8 (google DNS server, for those who would still ignore it)
=> normal delivery.
Google solves the name, and provides a v4 address. v4 only.

case 2: 2001:470:20::2 (HE DNS server, for those who would still ignore it)
=> "no IP address found for host 2a00"

case 3: 2a01:e00::2 , my ISP v6 DNS
=> "R=gmail_route defer (-36): host lookup for smtp.gmail.com did not complete (DNS timeout?)"

case 4: 212.27.40.241
=> "no IP address found for host 2a00"
my ISP DNS server for v4 clients; it used to provide v4 only resolution, but now provides full hybrid resolution v4 + v6.

I should use 2a01:e00::2 as normal DNS to use benefits of v6, and 212.27.40.241 as secondary backup. Because of this bug, I now have to use 8.8.8.8 which is a v4 only DNS server; and because of Google policy, I know it will always be v4 only server. But, this server is deadly SLOW. I am in France, and 8.8.8.8 is on the other side of the world.

Took me weeks to understand how to track the issue, strating with such a small error message. All google searches ended up with "peer server admin is a stupid guy who can't configure properly his network". But I dare thinking I know to configure my box. And what I am sure about today is that ... exim tries to solve smtp.gmail.com ... and thiks that it's IP is 2a01 ... which, by great hasard, is the beginning if it's v6 IP ...

More facts: I have been setting up Uranus with IPv6 flag from start (from the very first chroot the flag was ON). All libs and all deps are build with IPv6. So, even if the bug is not in exim package, but in some kind of dep, the issue is IPv6 IMHO.

[ebuild   R   ] mail-mta/exim-4.76  USE="X dkim dsn gnutls ipv6 maildir mbx pam perl sasl ssl syslog tcpd -dcc -dnsdb -dovecot-sasl -exiscan-acl -ldap -lmtp -mysql -nis -postgres -radius -spf -sqlite -srs" 0 kB
Comment 1 DEMAINE Benoît-Pierre, aka DoubleHP 2011-08-14 00:31:38 UTC
Created attachment 283245 [details]
/tmp/emerge--info
Comment 2 DEMAINE Benoît-Pierre, aka DoubleHP 2011-08-14 00:34:00 UTC
Created attachment 283247 [details]
/tmp/mail-mta:exim-4.76:20110813-235409.log

I have been nice, and unziped log for convenience :)

(just in case Bugzilla bug about ziped file would not be fixed yet)
Comment 3 Fabian Groffen gentoo-dev 2011-08-15 07:12:05 UTC
ok, my exim's are doing ipv6 accepts and transfers for a long time, so my first reaction to this bug is a big surprise.

Since you mention so many dns servers to try, you make it very suspicious to me whether or not you've got your dualstack setup properly.

I would be more interested in the exim_main.log file for the cases where you tried to make it send over ipv6.
Comment 4 DEMAINE Benoît-Pierre, aka DoubleHP 2011-08-15 07:24:21 UTC
The very first error message I got was:

    host gmail-smtp-msa.l.google.com [2a00:1450:8005::6d]:
    530-5.5.1 Authentication Required. Learn more at

Then i looked in my conf, to check why Exim stopped sending my password to authenticate to SMTP-relay (gmail). Took hours to come up to DNS issue.

I have put exim in the title because Bugzilla requires a package name. In the end of report, i say that it could be a dep. How do i check my dual stack ? exim is the first software making me problems. I don't use IPv6 intensively.

I did not found any exim_main.log . Only got /var/log/messages , and I already gave what I have. I could make exim output logs somewhere else, but I already failed to make it more verbose. Asked help to many people. When forums fail, I have to come up here.
Comment 5 Fabian Groffen gentoo-dev 2011-08-15 07:50:28 UTC
Ok, so how did you handle the authentication required problem?  It indicates to me Exim at that point did exactly the right thing, IPv6 wise.

From the errors you get, I guess you did something like:

xxxxx:
  transport = 20a2::xxx:0

which would be wrong, as [ and ] are required around such address.  However, that's just guessing, as I cannot see what you did to overcome the authentication problem.
Comment 6 DEMAINE Benoît-Pierre, aka DoubleHP 2011-08-15 15:51:08 UTC
Created attachment 283437 [details]
/tmp/exim.com

The authentification error problem occurs after Syslog says "no IP address found for host 2a00". It was a tricky one. To fix the Gmail authentification issue, I changed my resolv.conf from 212.27.40.241 8.8.8.8 (or any v4 DNS answering v4 only answers to -t ANY requests). It was a tricky one. 

I knew at once it could not be an auth issue because I changed that password on jan 2nd 2011 everywhere it required to be changed; I change THIS password every 3 years. IT was working fine since 6 months.  And the same day, it was working fine on other systems. And I had not touched exim conf on that day: if it was working the day before, it ought to work that day. But, that day, my ISP admitted to have changed DNS conf ... what a hasard ... isn't it ? and when stopping use of ISP DNS, exim suddenly got the right password ... 

If you think the host has a dual stack issue, I have no clue how to check it. What I know is that http://www.whatismyip.com/ gives me a v4 ad, and http://www.whatismyipv6.com/ and v6 one. And I can browse ipv6.google.com and http://[2a00:1450:4001:c01::68] . If dual stack is more than this, you tell me.
Comment 7 Fabian Groffen gentoo-dev 2011-08-15 15:57:49 UTC
your dual stack seems fine

Your conf file confuses me, though.  Why do you have two ways to contact gmail smtp?
Comment 8 DEMAINE Benoît-Pierre, aka DoubleHP 2011-08-15 16:03:57 UTC
I don't know which section is the good one. I thought the later was a dep of the first one. But after 100th re-reading, i agree with you they look like dups.

Still, even if that part of my conf is wrong, I don't see how it could explain the "no IP address found for host 2a00" message.
Comment 9 DEMAINE Benoît-Pierre, aka DoubleHP 2011-08-15 16:21:13 UTC
I simplified

[...]
acl_check_data:
  accept
begin routers
gmail_route:
        driver = manualroute
        domains = ! +local_domains
        transport = gmail_relay
        route_list = * smtp.gmail.com
system_aliases:
[...]
begin transports
gmail_relay:
        driver = smtp
        port = 587
        hosts_require_auth = $host_address
        hosts_require_tls = $host_address
local_delivery:
[...]

removed dnslookup: and remote_smtp: sections. Did not fix the issue.
Comment 10 Fabian Groffen gentoo-dev 2011-08-15 17:17:31 UTC
didn't expect that either

what happens if you use [2a00:1450:8002::6d] iso smtp.gmail.com?
Comment 11 DEMAINE Benoît-Pierre, aka DoubleHP 2011-08-15 17:19:50 UTC
gmail_route:
        driver = manualroute
        domains = ! +local_domains
        transport = gmail_relay
#       route_list = * smtp.gmail.com
        route_list = * [2a00:1450:8002::6d]


Aug 15 19:19:07 uranus exim[8650]: 2011-08-15 19:19:07 1Qt0od-0002FN-CQ no IP address found for host [2a00
Comment 12 Fabian Groffen gentoo-dev 2011-08-15 17:25:33 UTC
http://www.exim.org/exim-html-current/doc/html/spec_html/ch20.html

section 5

it suggests you use something like:

route_list = * "</ [2a00:1450:8002::6d]"
Comment 13 DEMAINE Benoît-Pierre, aka DoubleHP 2011-08-15 17:27:13 UTC
no IP address found for host [2a00:1450:8002::6d]
Comment 14 Fabian Groffen gentoo-dev 2011-08-15 17:30:52 UTC
and if you add the port, like the example does?
Comment 15 DEMAINE Benoît-Pierre, aka DoubleHP 2011-08-15 17:35:10 UTC
# http://kb.philross.co.uk/2008/03/15/configuring-exim-to-use-gmail-as-a-smarthost/
gmail_route:
        driver = manualroute
        domains = ! +local_domains
        transport = gmail_relay
#       route_list = * smtp.gmail.com
# http://www.exim.org/exim-html-current/doc/html/spec_html/ch20.html
#       route_list = * "smtp.gmail.com"
#       route_list = * [2a00:1450:8002::6d]
#       route_list = * "</ [2a00:1450:8002::6d]"
        route_list = * "</ [2a00:1450:8002::6d]:587"


Aug 15 19:34:26 uranus exim[10706]: 2011-08-15 19:34:26 1Qt13Q-0002mQ-CU no IP address found for host 2a00
Comment 16 Fabian Groffen gentoo-dev 2011-08-15 17:50:31 UTC
I just tried this on my server:

# IPv6 delivery test route
zeus_route:
  driver = manualroute
  transport = remote_smtp
  domains = my.domain
  route_list = * "<+ [zeus:ipv6:address]:25"

Sending email just worked out fine:

2011-08-15 19:47:02 1Qt1DK-0001vN-HI => me@my.domain R=zeus_route T=remote_smtp H=zeus:ipv6:address [zeus:ipv6:address] X=TLSv1:AES256-SHA:256
Comment 17 DEMAINE Benoît-Pierre, aka DoubleHP 2011-08-15 18:00:29 UTC
in my first comment, by dep, i meant libc or lib or sth deep, used only by exim, and not by ping/firefox ...
Comment 18 Fabian Groffen gentoo-dev 2011-10-10 17:01:44 UTC
Well, firefox uses it's own dns resolving, ping uses getaddrbyname stuff (aka -lresolv) IMO.  I think exim uses the host libs (glibc in your case) to resolve hosts as well.

I wonder if you could get my example running, that is, some delivery attempted.
Comment 19 Fabian Groffen gentoo-dev 2011-11-06 09:17:21 UTC
per comment #18
Comment 20 DEMAINE Benoît-Pierre, aka DoubleHP 2011-11-06 19:55:03 UTC
I did your test, and posted the result earlier.
Comment 21 Fabian Groffen gentoo-dev 2011-11-06 19:59:12 UTC
my test case is substantially different from yours
Comment 22 DEMAINE Benoît-Pierre, aka DoubleHP 2011-11-06 20:13:51 UTC
My last test was comment 15; then you pasted your conf in comment 16. I did not find any major difference between my test, and your paste. => after my last result, you did not submit any new test.
Comment 23 Fabian Groffen gentoo-dev 2011-11-06 20:18:21 UTC
So Exim doesn't even attempt to perform IPv6 delivery in your case.  Then the problem must be something else on your side.  Most likely causes, Exim doesn't know about ipv6, your stack isn't properly setup, or something else that makes Exim completely ignore IPv6 in your case.
Comment 24 DEMAINE Benoît-Pierre, aka DoubleHP 2011-11-06 20:28:08 UTC
Similar issues frequently happen with local problems. Either on upstream or Gentoo side, locales are known to make libc misunderstand some letters or symbol, and lead some apps to misdetect field separators ...

Emerge --version is irrelevant, because emerge is run under user console, while exim is run in background, by init itself, with a possibly different profile (different variables, different locales ... ). I often have issues within cron.

Can be almost anything.

Facts remain facts. "no IP address found for host 2a00" remains an /inapropriate/ error message.
Comment 25 Fabian Groffen gentoo-dev 2011-11-06 21:07:44 UTC
Then take your problem upstream.  Gentoo is just a packager, we can/do not fix all ins and outs of each package we package.
Comment 26 DEMAINE Benoît-Pierre, aka DoubleHP 2011-11-06 21:08:37 UTC
To which upstream ? exim ? libc ? libdns ?
Comment 27 Fabian Groffen gentoo-dev 2011-11-06 21:24:02 UTC
You have a problem with Exim's error reporting, so I guess Exim's.
Comment 28 Fabian Groffen gentoo-dev 2012-10-09 18:06:40 UTC
ipv6 is running fine on multiple sites with Exim