|
|
|
Using an ip address worked, no surprise.
nslookup produced the same result as getent. Some debug spew, the stack trace under this looks the same as the last one, so I cut it off: DEBUG: JavaMail version 1.3.2 DEBUG: java.io.FileNotFoundException: /usr/java/jre1.5.0_12/lib/javamail.providers (No such file or directory) DEBUG: !anyLoaded DEBUG: not loading resource: /META-INF/javamail.providers DEBUG: successfully loaded resource: /META-INF/javamail.default.providers DEBUG: Tables of loaded providers DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]} DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]} DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map DEBUG: !anyLoaded DEBUG: not loading resource: /META-INF/javamail.address.map DEBUG: java.io.FileNotFoundException: /usr/java/jre1.5.0_12/lib/javamail.address.map (No such file or directory) DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc] DEBUG SMTP: useEhlo true, useAuth true DEBUG SMTP: useEhlo true, useAuth true DEBUG SMTP: trying to connect to host "mail.wardrobe.irobot.com", port 25, isSSL false Sep 6, 2007 8:48:28 AM com.zutubi.pulse.web.ajax.TestSmtpAction execute SEVERE: Unable to send test email: Unknown SMTP host: mail.wardrobe.irobot.com; nested exception is: java.net.UnknownHostException: mail.wardrobe.irobot.com javax.mail.MessagingException: Unknown SMTP host: mail.wardrobe.irobot.com; nested exception is: java.net.UnknownHostException: mail.wardrobe.irobot.com Hi again,
Thanks for the info. Unfortunately the debug output does not say any more about the problem. Perhaps there is something unusual about the network setup on this machine? Does the machine have multiple NICs/IP addresses? Also, I have attached a simple JAR to this issue that may help debug. You can run it like so to do a Java name lookup: $ java -cp nettest.jar com.zutubi.nettest.DNSTest google.com 72.14.207.99 64.233.187.99 64.233.167.99 It would be interesting to know if this gives you an unknown host exception for your FQDN. It would also be interesting if other lookups work with this JAR. It failed.
I looked at it in strace, to see whether the resolver was engaged the right way. It appeared that the mdns4_minimal was being asked, but it wasn't then going on to ask DNS. So I stuck dns in front of mdns4_minimal in the nsswitch.conf file, and it worked. So this is the situation: With nsswitch correctly configured, I can resolve all addresses normally with getent, but not with your program: dtodd@ethanol:~/src> grep hosts /etc/nsswitch.conf #hosts: db files nisplus nis dns hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 #hosts: files dns mdns4_minimal [NOTFOUND=return] dns mdns4 __________________________________________________________________________ [17:24:33] dtodd@ethanol:~/src> java -cp nettest.jar com.zutubi.nettest.DNSTest google.com java.net.UnknownHostException: google.com: google.com at java.net.InetAddress.getAllByName0(Unknown Source) at java.net.InetAddress.getAllByName0(Unknown Source) at java.net.InetAddress.getAllByName(Unknown Source) at com.zutubi.nettest.DNSTest.main(DNSTest.java:20) __________________________________________________________________________ [17:24:43] dtodd@ethanol:~/src> java -cp nettest.jar com.zutubi.nettest.DNSTest hackmac.local java.net.UnknownHostException: hackmac.local: hackmac.local at java.net.InetAddress.getAllByName0(Unknown Source) at java.net.InetAddress.getAllByName0(Unknown Source) at java.net.InetAddress.getAllByName(Unknown Source) at com.zutubi.nettest.DNSTest.main(DNSTest.java:20) __________________________________________________________________________ [17:24:46] dtodd@ethanol:~/src> getent hosts google.com 64.233.167.99 google.com 72.14.207.99 google.com 64.233.187.99 google.com __________________________________________________________________________ [17:24:49] dtodd@ethanol:~/src> getent hosts hackmac.local 192.168.161.75 hackmac.local With it configured incorrectly: __________________________________________________________________________ [17:24:51] dtodd@ethanol:~/src> sudo vi /etc/nsswitch.conf __________________________________________________________________________ [17:25:07] dtodd@ethanol:~/src> grep hosts /etc/nsswitch.conf #hosts: db files nisplus nis dns #hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 hosts: files dns mdns4_minimal [NOTFOUND=return] dns mdns4 __________________________________________________________________________ [17:25:18] dtodd@ethanol:~/src> java -cp nettest.jar com.zutubi.nettest.DNSTest google.com 72.14.207.99 64.233.187.99 64.233.167.99 __________________________________________________________________________ [17:25:25] dtodd@ethanol:~/src> java -cp nettest.jar com.zutubi.nettest.DNSTest hackmac.local java.net.UnknownHostException: hackmac.local: hackmac.local at java.net.InetAddress.getAllByName0(Unknown Source) at java.net.InetAddress.getAllByName0(Unknown Source) at java.net.InetAddress.getAllByName(Unknown Source) at com.zutubi.nettest.DNSTest.main(DNSTest.java:20) __________________________________________________________________________ [17:25:28] dtodd@ethanol:~/src> getent hosts google.com 64.233.187.99 google.com 64.233.167.99 google.com 72.14.207.99 google.com __________________________________________________________________________ [17:25:32] dtodd@ethanol:~/src> getent hosts hackmac.local 192.168.161.75 hackmac.local So it appears that your program, or maybe java, doesn't play well with mdns4_minimal. I can't have that, we use mdns extensively here. Hi again,
Thanks for the detailed debugging. I have little experience with mdns, so forgive me if my ignorance is showing :). The test program I sent does the simplest possible lookup in Java. Thus this is a problem that would affect all Java programs using the standard Java networking APIs on your machine. Your correct nsswitch.conf setup is very common, indeed it appears to be the default on a lot of recent releases of various distros. Thus, if all Java networking failed on all machines with this nsswitch.conf, I would expect to be able to find a lot of error reports out there. My searches turned up nothing this specific. I guess part of the reason may be that many people do not use mdns and may not even have the requisite packages installed for its use to be attempted at all. It may also be that something else in your machine configuration is interacting badly with Java. One of the more promising leads was a bug report against Debian, where a dist-upgrade to sid caused nsswitch.conf to be updated to exactly your configuration: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=392813 The interesting thing here is that it only affected users with "search local" or "search <something>.local" in their resolv.conf. The conclusion was that this is incompatible with mdns4_minimal and in fact is not recommended for use with MDNS. Do you have such a line in resolv.conf? The one thing I cannot explain by this is why getent would still work, but otherwise it fits the symptoms perfectly (i.e. not trying dns after mdns4_minimal as search local will case a search for everything under .local). |
||||||||||||||||||||||||||||||||||||||||||||||||||
This is a puzzler. AFAIK, the JavaMail system we use should just be doing a normal connect to the specified host on port 25, which should mean a regular host lookup. Perhaps the way lookups happen from Java is not the same as getent. It may be possible to get more debug information by setting the system property "mail.debug" to true. The simplest way to do this is to hit the URL:
http://<pulse host>/admin/addSystemProperty.action?mail.debug=true
Then, next time you test the SMTP settings, you should get debug output to Pulse's standard out (may be $PULSE_HOME/logs/wrapper.log if you started as a service). Other things to try:
1) Do a lookup using nslookup. I believe this removes some of the things that getent takes into account, and it may be interesting if it returns a different result to getent.
2) Try using the IP address instead. If this works then at least it will get you going for now.
Sorry I can't be more specific at this stage!