Mail Server Connection Failed With 'java.net.SocketException: Permission denied: connect.' Exception

お困りですか?

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

コミュニティに質問

症状

Mail server configuration in Bitbucket Server fails with the following exception:

2013-06-02 18:57:07,688 WARN  [http-bio-7990-exec-7]
 kaveh 1137x424x1 1rlae3i 49.14.35.22 "POST /admin/mail-server HTTP/1.1"
 c.a.s.i.w.a.MailServerConfigurationController Failed to send a test 
email message to <Email Recipient>
com.atlassian.bitbucket.exception.MailSendException: Message not sent: Mail sending failed
.
.
.
Caused by: org.springframework.mail.MailSendException: Mail server 
connection failed; nested exception is javax.mail.MessagingException: 
Could not connect to SMTP host: localhost, port: 25;
  nested exception is:
	java.net.SocketException: Permission denied: connect. Failed messages: 
javax.mail.MessagingException: Could not connect to SMTP host: 
localhost, port: 25;
  nested exception is:
	java.net.SocketException: Permission denied: connect
	at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:400) ~[spring-context-support-3.2.1.RELEASE.jar:3.2.1.RELEASE]
	at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:340) ~[spring-context-support-3.2.1.RELEASE.jar:3.2.1.RELEASE]
	at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:355) ~[spring-context-support-3.2.1.RELEASE.jar:3.2.1.RELEASE]
	at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:344) ~[spring-context-support-3.2.1.RELEASE.jar:3.2.1.RELEASE]
	at com.atlassian.bitbucket.internal.mail.MailServiceImpl.sendMessageSynchronously(MailServiceImpl.java:205) ~[bitbucket-service-impl-2.4.2.jar:na]
	... 182 common frames omitted
Caused by: javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25

原因

This is one of the known issues with Java 7, as per this post.

This can also be caused by any anti-virus or firewall software installed on the server.

ソリューション

  1. Use the -Djava.net.preferIPv4Stack=true JVM system property to help enable support for IPv4 on Java 7.
  2. Check that anti-virus and firewall software on the server is not blocking Bitbucket Server's ability to connect to the mail server.
最終更新日 2016 年 4 月 6 日

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

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