Tel +49 (30) 814504070

javax.mail: 501 Syntactically invalid HELO argument(s)

These days I ran into trouble when setting up out java-baes CMS on a fresh installed debian.

Almost everything worked fine except the newsletter tool. Looking at the catalina.log I found the following stacktrace:

javax.mail.MessagingException: 501 Syntactically invalid HELO argument(s)
      at com.sun.mail.smtp.SMTPTransport.issueCommand(SMTPTransport.java:1308)
      at com.sun.mail.smtp.SMTPTransport.helo(SMTPTransport.java:785)
      at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:327)
      at javax.mail.Service.connect(Service.java:236)
      at javax.mail.Service.connect(Service.java:137)
      at javax.mail.Service.connect(Service.java:86)

A googlesearch pointed me to the sun developer network. Assuming that there are config problems I decieded not to introduce the config parameter mail.smtp.localhost (I never needed to use it before).

When looking at the mentioned javadocs I found

mail.smtp.localhost String Local host name used in the SMTP HELO or EHLO command. Defaults to “InetAddress.getLocalHost().getHostName()”. Should not normally need to be set if your JDK and your name service are configured properly.

Okay, following that hint I tried a quick coded test program:

import java.net.*;
public class test {
   public static void main ( String [] args ) {
     try {
       System.err.println( InetAddress.getLocalHost().getHostName() );
     } catch ( Exception e ) {
       e.printStackTrace();
     }
   }
}

When running it: boing!:

(I replaced my domain name).)

formel5@gruender-mv:~/domains/gmv$ java test
java.net.UnknownHostException: mydomain: mydomain
        at java.net.InetAddress.getLocalHost(InetAddress.java:1191)
        at test.main(test.java:5)

Okay. need to fix my /etc/host: added mydomain (And talk to my admin ;-) )

formel5@gruender-mv:~/domains/gmv$ java test
mydomain


Fine. Now I restarted my newsletter webapp without any problems

About CosmoCode

CosmoCode is a Berlin based IT service provider with a strong emphasis on web applications. We mainly focus on Content Management Systems, Wikis and custom solutions.

Subscribe

Subscribe Like our blog? Stay up to date via RSS
Freie Stelle: Forschungsassistent Freie Stelle: Forschungsassistent