springboot 健康检查 MessagingException: 501 Syntax: HELO hostname

springboot 健康检查 MessagingException: 501 Syntax: HELO hostname

Caused by: javax.mail.MessagingException: 501 Syntax: HELO hostname
at com.sun.mail.smtp.SMTPTransport.issueCommand(SMTPTransport.java:1363)
at com.sun.mail.smtp.SMTPTransport.helo(SMTPTransport.java:838)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:375)
at javax.mail.Service.connect(Service.java:248)

 

原因,该机器的dns服务地址未配置正确。 例如本服务器的hostname为 service,但是service 不能正确解析。

1.  可以直接修改 /etc/hosts  将本服务器的hostname 映射成为 127.0.0.1

或者

2. 可以springboot 添加配置项直接设置为本机ip地址。

mail.smtp.localhost = 127.0.0.1

 

此篇文章已被阅读1587 次

Add a Comment

邮箱地址不会被公开。 必填项已用*标注