Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!feeds.phibee-telecom.net!usenet.ukfsn.org!not-for-mail From: Martin Gregorie Newsgroups: comp.lang.java.programmer Subject: Re: JavaMail bug? Date: Tue, 2 Aug 2011 20:01:36 +0000 (UTC) Organization: UK Free Software Network Lines: 100 Message-ID: References: <995djcFq0nU1@mid.individual.net> <99njvpFv11U1@mid.individual.net> <99qjntFk6uU1@mid.individual.net> NNTP-Posting-Host: 84.45.235.129 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: localhost.localdomain 1312315296 17541 84.45.235.129 (2 Aug 2011 20:01:36 GMT) X-Complaints-To: usenet@localhost.localdomain NNTP-Posting-Date: Tue, 2 Aug 2011 20:01:36 +0000 (UTC) User-Agent: Pan/0.133 (House of Butterflies) Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6763 On Tue, 02 Aug 2011 16:34:20 +0100, Nigel Wade wrote: >> What does my SSCE do in your environment? > > I get: > > javax.mail.MessagingException: Unknown SMTP host: zoogz.gregorie.org; > nested exception is: > java.net.UnknownHostException: zoogz.gregorie.org > > I presume your DNS does not propagate upward from your zone. > Correct. Its definitive only within my LAN and my firewall refused all connections from outside. > But it /is/ attempting to resolve that hostname via our DNS servers. > It's not using localhost. > Interesting. I wonder why we're seeing a difference. I assume you ran it with no command line arguments except (possibly) 'debug'. When I do that the debugging text says that it was trying to connect to zoogz.gregorie.org. Lines 7 and 8 show the first 220 followed a DEBUG line reporting this. Then lines 31 and 32 report a failure to connect to localhost and the resulting exception. If you're following this with Wireshark I'd expect you to see the first connect attempt but maybe not the second. Here's the debugging output: $ java MATestMail debug DEBUG: setDebug: JavaMail version 1.4.4 DEBUG: getProvider() returning javax.mail.Provider [TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc] DEBUG SMTP: useEhlo true, useAuth false DEBUG SMTP: trying to connect to host "zoogz.gregorie.org", port 25, isSSL false 220 zoogz.gregorie.org ESMTP Postfix DEBUG SMTP: connected to host "zoogz.gregorie.org", port: 25 EHLO zappa.gregorie.org 250-zoogz.gregorie.org 250-PIPELINING 250-SIZE 51200000 250-VRFY 250-ETRN 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN DEBUG SMTP: Found extension "PIPELINING", arg "" DEBUG SMTP: Found extension "SIZE", arg "51200000" DEBUG SMTP: Found extension "VRFY", arg "" DEBUG SMTP: Found extension "ETRN", arg "" DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg "" DEBUG SMTP: Found extension "8BITMIME", arg "" DEBUG SMTP: Found extension "DSN", arg "" smtp://kiwi@zoogz.gregorie.org smtp://kiwi@zoogz.gregorie.org DEBUG: getProvider() returning javax.mail.Provider [TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc] DEBUG SMTP: useEhlo true, useAuth false DEBUG SMTP: trying to connect to host "localhost", port 25, isSSL false javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25; nested exception is: java.net.ConnectException: Connection refused at com.sun.mail.smtp.SMTPTransport.openServer (SMTPTransport.java:1934) at com.sun.mail.smtp.SMTPTransport.protocolConnect (SMTPTransport.java:638) at javax.mail.Service.connect(Service.java:295) at javax.mail.Service.connect(Service.java:176) at javax.mail.Service.connect(Service.java:125) at javax.mail.Transport.send0(Transport.java:194) at javax.mail.Transport.send(Transport.java:124) at MATestMail.main(MATestMail.java:59) Caused by: java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351) at java.net.PlainSocketImpl.connectToAddress (PlainSocketImpl.java:213) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:529) at java.net.Socket.connect(Socket.java:478) at com.sun.mail.util.SocketFetcher.createSocket (SocketFetcher.java:288) at com.sun.mail.util.SocketFetcher.getSocket (SocketFetcher.java:231) at com.sun.mail.smtp.SMTPTransport.openServer (SMTPTransport.java:1900) ... 7 more At this point I really am going to drop off the net for a few days - got a 5AM start tomorrow. -- martin@ | Martin Gregorie gregorie. | Essex, UK org |