Solve Linux systems deployed webapp, JavaMail to send mail javax.mail.MessagingException: 501 Syntax: HELO hostname problem

Solution:
1, first check the host name of the server with the hostname, then the local ping tentative about this hostname, unfortunately can not find the corresponding ip host.
2, modify the / etc / hosts file, add the hostname of 127.0.0.1 name corresponds to the top, oh! Send mail times, success!

The reason:
After JavaMail when sending mail, extracts the local hostname, ip will have the form to send a message, but in linux server, can not resolve the local ip address corresponding to the hostname, resulting in JavaMail can not call ip sent. Postfix will reject messages received this transmission, an error 501 is generated. (Windows server may send, thanks not be netbios protocol to get the ip address of the host, it is possible to obtain ip)

editing operations

 

Guess you like

Origin www.cnblogs.com/htzsyy/p/11221051.html