At 17:53 10/26/99 -0400, Brian Wellington wrote:
>On 26 Oct 1999, Juergen Kreileder wrote:
>
>> As said before, what java tries to do is:
>> 
>> 1. Connect to System.getProperty("mail.host") on the smtp port (number
>>    25).
>> 2. If 1 failed connect to localhost on the smtp port
>> 3. If 2 failed lookup mailhost (which is not the same as localhost on
>>    many systems), if mailhost is unknown throw a UnknownHostException
>>    else try to connect to mailhost on the smtp port, if that fails
>>    throw a ConnectException.
>
>The problem is that (3) uses the InetAddr class to do a DNS lookup, which

this is correct behavior. At that point in step 3 you should have either
a DNS name, or an IP address; either is a valid input to getHostByName.

>calls gethostbyname (on unix, at least).  This is just plain wrong, since
>this looks up A records for mailhost, when it should be looking up MX

again, this is the correct behavior. The mail.host system property and
mailhost DNS alias should both refer to a host which is running an MTA
on the standard port and willing to accept outbound mail from this node.
Said host reference may be via TCP/IP address or DNS name.

>records of mailhost.  So, if mailhost has MX records and no A records,
>which is perfectly valid, java will fail.

no, actually that is not a valid DNS configuration. Per rfc974 MX records
may only refer to hosts. (A records per rfc1034) MX records in fact play
no part in this discusion as they map how to get mail into a domain, not
out of it.

>There's no good way around this.

sure there is. correctly configure your machine per the standard. java
is trying to be friendly and handle most cases of missing configuration
by trying all the posibilities in order of likelyhood to work - here it
shows it's attempts to be cross-platform; had this been a unix program
it would have tried the standard configuration for smtp host and failing
that would have errored rather than trying to trackdown the other ways to
configure.

As this is now certainly offtopic for java-linux (and I'll assume
advanced-java as well) please followup off list if you choose. -=Chris

  cabbey at home dot net <*> http://members.home.net/cabbey
           I want a binary interface to the brain!
Today's opto-mechanical digital interfaces are just too slow!


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to