james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Wellington <bwell...@xbill.org>
Subject RE: Mystery: Unknown SMTP host exception for a known host
Date Fri, 07 Mar 2003 18:16:58 GMT
On Fri, 7 Mar 2003, Noel J. Bergman wrote:

> Chris Burdess reproduced the problem last night, and when I ran a little
> test driver on both Windows and linux, I found that this works on Windows
> and fails on linux:
> 
> 	static public void main(String[] args)
> 	{
> 		String host = "193.95.196.170.";
> 		int port = 25;
> 
> 		try {
> 			java.net.Socket socket = new java.net.Socket(host, port);
> 		} catch (java.net.UnknownHostException uhex) {
> 			uhex.printStackTrace();
> 		} catch (java.io.IOException ioe) {
> 			ioe.printStackTrace();
> 		}
> 	}
> 
> If you remove the trailing '.' from the IP address it succeeds on both.
> 
> I ran additional tests to see why connecting doesn't always fail on linux.
> dnsjava lookup (including his current release) adds a trailing '.' to the
> result from the MX record search.  If lookup results in a CNAME (canonical
> name, e.g., mail.server.tld) it is handled fine by Sun's linux
> implementation, but if it results in an A record (IP address) it fails (as
> demonstrated above).
> 
> So we have a resolution, and understanding of the issue.  I am CC'ing the
> JavaMail-Interest list to close the issue, since it is not a JavaMail
> problem (although Sun might look into the differential behavior of Java),
> and Brian Wellington, author of dnsjava.

dnsjava does not add a trailing dot to the result of an MX lookup; it adds 
a trailing dot to all absolute domain names.  The mail host in an MX 
record will have a trailing dot, and the IP address in an A record will 
not (as it's not a domain name).  If there's a situation where an MX 
record points to an IP address instead of a domain name, it won't work, 
but it's a broken configuration and shouldn't work.

Adding a trailing dot to an IP address shouldn't work, as it's no longer a 
valid IP address.

I don't think this is a problem with dnsjava, but if you think so, give me 
specific examples of the failure and I'll look into it.

Brian

---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org


Mime
View raw message