On Sat, 18 Nov 2006, B. Johannessen wrote:
> ----------------------------------------------------------------------
> A looked up name is accepted only if it leads back to the original IP
> address via a forward lookup. If either the reverse or the forward
> lookup fails to find any data, or if the forward lookup does not yield
> the original IP address, $sender_host_name remains empty, and
> $host_lookup_failed is set to ?1?.
> ----------------------------------------------------------------------
>
> The way I understand the above paragraph, $sender_host_name will remain
> empty unless both the reverse and forward lookup succeeds, *and* the
> forward lookup yields the original IP address. This understanding does
> not agree with observed behavior (exim-snapshot-2006-10-16), as the
> following ACL fragment/log lines shows:
> I would consider this a bug either in Exim itself of the Exim
> specification. I'll leave it to whoever wrote the relevant
> code/documentation to figure out which :-)
That has to be me. It's a bug in the code, because the documentation
also says this:
Looking up a host's name from its IP address consists of more than
just a single reverse lookup. Exim checks that a forward lookup of
at least one of the names it receives from a reverse lookup yields
the original IP address. If this is not the case, Exim does not
accept the looked up name(s), and $host_lookup_failed is set to "1".
Thus, being able to find a name from an IP address (for example, the
existence of a PTR record in the DNS) is not sufficient on its own
for the success of a host name lookup. If the reverse lookup
succeeds, but there is a lookup problem such as a timeout when
checking the result, the name is not accepted, and
$host_lookup_deferred is set to "1". See also $sender_host_name.
> --- host.c-orig Sat Nov 18 00:22:45 2006
> +++ host.c-new Sat Nov 18 00:23:22 2006
> @@ -1792,6 +1792,7 @@
> {
> HDEBUG(D_host_lookup) debug_printf("temporary error for host name
> lookup\n");
> host_lookup_deferred = TRUE;
> + sender_host_address = NULL;
> return DEFER;
> }
Er, that should be sender_host_name = NULL !
I will shortly commit a patch with this fix in it, so it will be in
tonight's snapshot.
Philip
--
Philip Hazel, University of Cambridge Computing Service.