ietf-smtp
[Top] [All Lists]

Re: RFC 2821 Address Resolution

2004-01-04 20:19:53


----- Original Message ----- 
From: "Richard O. Hammer" <ROHammer(_at_)earthlink(_dot_)net>
To: "IETF-SMTP" <ietf-smtp(_at_)imc(_dot_)org>
Sent: Sunday, January 04, 2004 3:23 PM
Subject: Re: RFC 2821 Address Resolution


Just to make sure we are using the same language, a "host" is a name
like mailin-02.mx.aol.com which you get in an MX record.  ....

Thanks for the clarification of the technical semantics; domain, host and
home. I agree it is useful to be consistent here.  But please excuse me if I
use domain, MX and IP (A record) here and there. :-)

Hector Santos wrote:
 > The logic I used is:
 >
 > 1) Sort the MX records (low to high) preference,
 > 2) For each MX, add the A records to the final list removing
duplicate ips.

That sounds right to me.  My code does not look for or remove
duplicate IPs; I do not remember seeing this suggested in the RFC, but
it makes sense.

Thanks. The technical question of timing came into play which I see you
address reading the rest of the message.

...

Further, the list of A-records appended to a MX query does not
pretend to be complete.  The lists which you show appear to me to be
truncated, perhaps at a size limit determined by the packet size.

Yes, I finalized realized this by switching to a stream lookup where all the
information came in.

An optimization: Since there are potentially many homes (maybe
sometimes even 100) for a given domain, and since my logs indicate to
me that the first attempt to connect to any home usually succeeds, 80%
of the time or better, it may be wasteful to prepare the entire list
of homes, sorted by host-priority, before attempting to connect to the
first home in the list.  The first attempt will probably succeed and
make the rest of the list useless.  Initially, my code does no more
DNS lookups than necessary to find the first home that it should
attempt for a domain; it postpones further DNS lookups and sorting
until needed, if ever.

Thanks, this seems to be the final conclusion to this exercise. :-)

I went back to see our original 1996 code and I see that it did a simple MX
(host) lookup, sorted them and then it used gethostbyname() when the sorted
MX was attempted by the sender.   Incorrect by RFC standards because it was
only using the first IP returned by gethostbyname(), not the entire list,
but it was more dynamic.  If it had to go to the second MX, the fresh lookup
would give more current information.

So the only real change here is to have the sender lookup all the homes (ip
addresses) for the host making it only necessary to do when needed.

However, the initial MX lookup A record information should be used to
further minimize the initial A records lookup by the sender for the first
MX.

-- 
Hector Santos, Santronics Software, Inc.
http://www.santronics.com









<Prev in Thread] Current Thread [Next in Thread>