If you are only
interested in what mail clients do, and can't find any
online explanation, you could either look at the source
code to some open source ones (probably the easiest
way),

to me, this feels rather the most troublesome way :-)


or set up a mail smarthost with multiple IP
addresses, and send an email through it, recording
traffic with tcpdump.

I think i'm gonna do that, but i wanted to ensure that
i didn't overlooked some blatently obvious www-page
somewhere already describing it in details.


But chances are that mail clients just do what any
other TCP client would do.

in my reckoning that would be to use gethostbyname(), and
use the first of the ip addresses returned unless some explicit failure occurs during connection setup (as for example connection refused, connection timeout, etc), and only then try the next ip address; and if tcp connection works but remote host returns garbage, just display some error message to the user (so no code to try again with other ip addresses in this case). older code might even not "see" the non-first returned ip address in the hostent structure returned by gethostbyname().

but since the above described is just my guess, i wanted to scrape other people's knowledge as well.


best wishes from,

max

Reply via email to