Skip to main content

Blarg#8: A stupid user trick for goggle to cache

Posted by jfalkner on October 11, 2004 at 2:27 PM PDT

Java's platform independence is great, except when it...er, the user doesn't work. Take for instance JavaMail. The API is great. Who doesn't love the ability to send e-mail, and few other simple programming tricks can make your boss ooh and ah like a customized e-mail.

If you are using linux and get the following, very-google-cachable exception.

javax.mail.MessagingException: 501 5.0.0 HELO requires domain address

        at com.sun.mail.smtp.SMTPTransport.issueCommand(SMTPTransport.java:1189)
        at com.sun.mail.smtp.SMTPTransport.helo(SMTPTransport.java:732)
        at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:293)
        at javax.mail.Service.connect(Service.java:233)
        at javax.mail.Service.connect(Service.java:134)
        at org.proteomecommons.EmailTools.main(EmailTools.java:68)

You'd be out of luck. Until now that is. The problem is as simple as translating your computer's IP address to a name. Just add the appropriate entry in /etc/hosts that converts your computer's IP to its hostname. For example, if your hostname is "Computer" (if you don't know type cat /etc/hostname), add "127.0.0.1 Computer" to /etc/hosts (or echo "127.0.0.1 Computer" >> /etc/hosts).

Run the code again and you are set.