Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Oct 2002 12:10:20 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        freebsd-questions@FreeBSD.ORG
Subject:   Re: fetchmail protocol error caused by DNS timeout - solution?
Message-ID:  <20021021111020.GC27016@happy-idiot-talk.infracaninophi>
In-Reply-To: <20021020215847.GA936@kirk.dlee.org>
References:  <20021020215055.GA586@kirk.dlee.org> <20021020215847.GA936@kirk.dlee.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Oct 20, 2002 at 05:58:47PM -0400, Doug Lee wrote:
> CORRECTION:  It's not an rDNS lookup that's causing my problem; it's a
> straight DNS lookup of the From: address, I think.  Example:  I just
> spotted a message coming in from m7.shineandsparkle.com which plugged
> up my ``fetchmail'' download (I have to go to the source mailbox and
> hand-delete the thing to get the rest of them to come in by
> fetchmail).  Pinging m7.shineandsparkle.com causes a long pause
> followed by
> 
> ping: cannot resolve m7.shineandsparkle.com.: Host name lookup failure
> 
> It appears that the same DNS lookup, when initiated by ``fetchmail,''
> is taking so long that the remote mail server gives up waiting, so
> that when DNS finally quits trying, ``fetchmail'' issues a protocol
> error, only to try again later and go through the same sequence.
> 
> Also, this problem is not fixed by using my ISP's DNS server instead
> of my own.

I assume you're using fetchmail(1) to feed the mail into the
sendmail(8) process on your own machine, which is likely the process
initiating the DNS lookups that are stalling everything.  

One thing that may be biting you is IPv6 support in sendmail.  As all
good Unix programs should nowadays, it uses getaddrinfo(3) rather than
gethostbyname(3) and it searches first for an AAAA record in the DNS.
Usually the DNS server will respond very quickly that such a record
doesn't exist and the next lookup will be for the IPv4 A record, which
should succeed.  Certain broken DNS servers however return the wrong
code when queried for a resource record type they don't recognise,
leading to delays similar to what you're seeing.

Check your /etc/mail/`hostname`.mc file --- there's been a workaround
for this problem in there since May this year, namely:

    define(`confBIND_OPTS', `WorkAroundBrokenAAAA')

You can tweak the resolver timeouts used by sendmail(8): grep for
'confTO_RESOLVER' in /usr/share/sendmail/cf/README (DANGER Will
Robinson! -- fiddling with resolver timeouts is not for the faint
hearted).  Other things that may bite you are ident queries, but those
are set to timeout after 5s by default, so they shouldn't have the
effect you're seeing.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
                                                      Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021021111020.GC27016>