james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Noel J. Bergman" <n...@devtech.com>
Subject Mystery: Unknown SMTP host exception for a known host
Date Thu, 06 Mar 2003 18:00:04 GMT
Ok, I'm stumped for the morning ...

When calling transport.connect(), we receive the following exception:

javax.mail.MessagingException: Unknown SMTP host: 193.95.196.170.;
  nested exception is:
        java.net.UnknownHostException: 193.95.196.170.
        at
com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:909)
        at
com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:158)
        at javax.mail.Service.connect(Service.java:233)
        at javax.mail.Service.connect(Service.java:134)
        at javax.mail.Service.connect(Service.java:86)
        at com.sun.mail.smtp.SMTPTransport.connect(SMTPTransport.java:95)

However, if I run the following, I get no exceptions:

    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);
            java.net.InetAddress addr =
java.net.InetAddress.getByName(host);
        } catch (java.net.UnknownHostException uhex) {
            uhex.printStackTrace();
        } catch (java.io.IOException ioe) {
            ioe.printStackTrace();
        }
    }

Yes, I know that the trailing '.' shouldn't be there; it is an artifact from
an older version of a particular DNS resolving library.

What is happening in the bowels of JavaMail to throw that UHE that isn't
represented in my test, and what needs to be done to prevent it?

	--- Noel


---------------------------------------------------------------------
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