EOF exception during mail due to wrong hostname in EHLO

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

 

要約

Confluence isn't able to send emails and an error message is shown in the user interface (UI) while sending out a test email. 

環境

Confluence server using any SMTP mail server.

診断

While sending test email, the following error is seen in the UI and the logs.

An error has occurred with sending the test email:
com.atlassian.mail.MailException: javax.mail.MessagingException: [EOF]
.
Caused by: javax.mail.MessagingException: [EOF]
	at com.sun.mail.smtp.SMTPTransport.issueCommand(SMTPTransport.java:2324)
	at com.sun.mail.smtp.SMTPTransport.helo(SMTPTransport.java:1678)

openssl s_client and other network tools like telnet can connect to the mail server properly.

Upon enabling SMTP debug logs we see the following messages.

DEBUG: JavaMail version 1.6.2
DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle]
DEBUG SMTP: useEhlo true, useAuth false
DEBUG SMTP: trying to connect to host "smtp-relay.mailserver.com", port 587, isSSL false
220 smtp-relay.mailserver.com ESMTP h18sm868180otk.3 - gsmtp
DEBUG SMTP: connected to host "smtp-relay.mailserver.com", port: 587
EHLO localhost
421 4.7.0 Try again later, closing connection. (EHLO) h18sm868180otk.3 - gsmtp
HELO localhost
DEBUG SMTP: EOF: [EOF]

(info) SMTP debug logs can be enabled via system property or setting the property mail.debug="true" in the mail session configuration of Confluence. 


原因

Confluence is presenting itself as localhost to the remote mail server.

EHLO localhost

Mail server isn't able to identify Confluence and terminates the connection. 


ソリューション

Confluence should be presenting a valid hostname to identify itself. hostname command in Linux is a good way to check what name comes up. Though, if hostname does return the proper hostname, then the following parameter can be configured in the mail session configuration of Confluence.

mail.smtp.localhost="correct_FQDN.com"


Alternatively, we have seen some cases on Linux systems where /etc/hosts contains entries for localhost and the hostname mapping them to 127.0.0.1.  On that case, make sure the hostname entry comes first:

127.0.0.1 localhost
127.0.0.1 <hostname>

Change it to:


最終更新日 2021 年 9 月 28 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.