Discussion:
Bug in $domain_data caching.
David Woodhouse
2004-02-07 13:59:49 UTC
Permalink
--
I think I found a bug where $domain_data isn't provided for lookups
which are cached.

Relevant snippets of log file (http://www.infradead.org/~dwmw2/domain):

At line 144 we see the first lookup succeed and stash the result.

144:lookup yielded: infradead.org.mail
145:infradead.org in "lsearch;/etc/exim/dns-virtual-domains"? yes (matched "lsearch;/etc/exim/dns-virtual-domains")
146:data from lookup saved for cache for +dns_virtual_domains: infradead.org.mail

At line 191 it attempts to verify the recipient address '***@infradead.org'.

At line 210 we see it use the cached result correctly and the
dns_virtual_domains router rewrites ***@infradead.org to
***@phoenix.infradead.org according to the wildcard TXT record
'*.infradead.org IN TXT @phoenix.infradead.org'

210:--------> dns_virtual_domains router <--------
211:local_part=asdasd domain=infradead.org
212:checking domains
213:cached yes match for +dns_virtual_domains
214:cached lookup data = infradead.org.mail

At line 456 it again tries to verify, this time with callouts enabled.
However, this time the cached lookup data are _lost_ by the time we
reach the dns_virtual_domains router at line 475:

475:--------> dns_virtual_domains router <--------
476:local_part=asdasd domain=infradead.org
477:checking domains
478:cached yes match for +dns_virtual_domains
479:cached lookup data = NULL

The DNS lookup then fails, causing a temporary error, which causes this
machine to operate in MX backup mode and accept the mail (which is to an
unknown recipient as phoenix.infradead.org _would_ have been able to
tell us.

--
dwmw2

--
Content-Description: Forwarded message - [Exim] $domain_data sometimes
unavailable during callout?

From: David Woodhouse <***@infradead.org>
To: exim-***@exim.org
Subject: [Exim] $domain_data sometimes unavailable during callout?
Sender: exim-users-***@exim.org
Precedence: bulk
Date: Thu, 22 Jan 2004 12:42:10 +0000

I have a router basically as follows, and was advised that I could use
$domain_data instead of $address_data in it. However it didn't work
during callouts.

The important part of the router is:

domainlist dns_virtual_domains = lsearch;CONFDIR/dns-virtual-domains

dns_virtual_domains:
domains = +dns_virtual_domains
address_data = ${lookup{$domain}lsearch{CONFDIR/dns-virtual-domains}}

I do two recipient verifications in my ACL -- one without a callout, and
the second with a callout, under certain circumstances. I find that the
first routing attempt sets $domain_data OK and everything works, but on
the _second_ I see $domain_data is NULL.

Full working config at http://www.infradead.org/~dwmw2/eximconf

Test logs with working ($address_data) and non-working ($domain_data)
at http://www.infradead.org/~dwmw2/address and
http://www.infradead.org/~dwmw2/domain respectively. Yes, I _did_
remember to replace _all_ instances of $address_data with $domain_data.

This is the important part when it fails...

--------> dns_virtual_domains router <--------
local_part=asdasd domain=infradead.org
checking domains
cached yes match for +dns_virtual_domains
cached lookup data = NULL

Yet the cached lookup data should be 'infradead.org.mail' and indeed was
earlier in the same log.

--
dwmw2


--

## List details at http://www.exim.org/mailman/listinfo/exim-users Exim details at http://www.exim.org/ ##

--


--

## List details at http://www.exim.org/mailman/listinfo/exim-users Exim details at http://www.exim.org/ ##
Philip Hazel
2004-02-09 09:52:06 UTC
Permalink
Post by David Woodhouse
I think I found a bug where $domain_data isn't provided for lookups
which are cached.
I see that I already have an item on my work list to investigate this,
as a result of a previous message you posted. Thanks for the additional
information.

Philip

--
Philip Hazel University of Cambridge Computing Service,
***@cus.cam.ac.uk Cambridge, England. Phone: +44 1223 334714.
Get the Exim 4 book: http://www.uit.co.uk/exim-book

--

## List details at http://www.exim.org/mailman/listinfo/exim-users Exim details at http://www.exim.org/ ##
David Woodhouse
2004-02-09 11:57:19 UTC
Permalink
Post by Philip Hazel
Post by David Woodhouse
I think I found a bug where $domain_data isn't provided for lookups
which are cached.
I see that I already have an item on my work list to investigate this,
as a result of a previous message you posted. Thanks for the additional
information.
OK, thanks -- I thought you'd missed it, as it was while you were away
and I hadn't included the word 'bug' in the subject on the first
occasion to catch your attention. :)

Let me know if you can't reproduce it and want me to clean up my config
a little so you can use it.

--
dwmw2


--

## List details at http://www.exim.org/mailman/listinfo/exim-users Exim details at http://www.exim.org/ ##
Loading...