I am trying to set up emailing from a java web application hosted on a linux server (Cent OS) in apache.

Sendmail is working fine from the command line as root on localhost but when trying to send emails from the java web app (also on the same server from localhost) the following java exception is thrown.

501 5.0.0 HELO requires domain address

EDIT: I have read that some people have found this is due to an incorrect hosts entry currently the hosts file contains

127.0.0.1 Centos-VPS localhost.localdomain localhost

and i'm not sure what the Centos-VPS bit at the start is for but this is a clients hosted server so don't really want to break stuff

EDIT see the RFC is helpful ...

501 Syntax error in parameters or arguments

Now I know what the problem is! (note the sarcasm people.)

link|improve this question
1  
What does your Java web app send as HELO? It should be something like yourhost.yourdomain.com – Janne Pikkarainen Jul 18 '11 at 7:17
it's configurable but have tried localhost and localhost.localdomain – ealgestorm Jul 18 '11 at 7:23
2  
And you are sure it really sends out those? Have you read the server mail log or observed the SMTP conversation in some other way? – Janne Pikkarainen Jul 18 '11 at 7:25
It's not sending any emails from the java web application but will send emails if I use mail from the command line. – ealgestorm Jul 18 '11 at 7:29
it's not listing a domain in the mail logs just 127.0.0.1 did not issue mail/expn/vrfy ... etc error – ealgestorm Jul 18 '11 at 7:31
show 6 more comments
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.