confluence mail server configuration method (step on pit)

1. Configure manner smtp host address (provided on congfluence web interface)

Here I use the Ali-mail (smtp server address smtp.mxhichina.com ), but 25, 465 ports are configured, to test but still receive mail

No response. (See log is as follows :)

The Internet to find information on most of the day, the last official document, there are instructions prompt (you can try to use port 587, to connect test)

官方链接: https://confluence.atlassian.com/confkb/mail-server-connection-failed-with-smtp-802593325.html
官方说明:
SMTP Port Optional. The port to connect to on the SMTP host.
FishEye needs to use port 25 or port 587, because unlike JIRA its initial connection doesn't use SSL. Port 25 will be used if no port is specified.

I try to use port 587, TLS options open without open mode, all unsuccessful. (I see online students with Tencent E-mail, 587 settings successfully received the message, I used the Ali or not, and I do not want to change the mailbox, strange trouble)

First of all, my service is deployed on aws, thinking even look at Ali's mail server through the barrier in the end, whether the port is not open.

telnet smtp.mxhichina.com 25   //不通
telnet smtp.mxhichina.com 587  //不通
telnet smtp.mxhichina.com 465  //通

Finally found, confluence in two ways when you set up mail service, try the next second.

2. The second way to solve this problem (to configure JNDI address by javax.mail.Session used)

(1)停止confluence服务
(2)将文件mail-1.4.5.jar从<confluence-install>/confluence/WEB-INF/lib文件中移动(不是复制)到<confluence-install>/lib文件下
<confluence-install>这里是安装路径我这里是(/home1/atlassian/confluence)
(3)在<confluence-install>/conf/下的server.xml添加如下代码(注意添加在</Context>标签之前)注意, 放在第一个context的标签块里,不然会报找不到 mail。
<Resource name="mail/mohangSMTPServer"
   auth="Container"
   type="javax.mail.Session"
   mail.smtp.host="smtp.mxhichina.com"
   mail.smtp.port="465"
   mail.smtp.auth="true"
   mail.smtp.user="自己的阿里邮箱"
   password="邮箱密码"  //腾讯的邮箱的话,应该是授权码
   mail.smtp.starttls.enable="true"
   mail.transport.protocol="smtps"  //协议类型
   mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"
   />
(4)启动confluence,继续配置【JNDI地址】
JNDI 地址是:java:comp/env/mail/mohangSMTPServer  注意:jndi地址必须和server.xml名称保持一致

Back to the confluence of the web mail server settings page, above and also as set before.

The following is set for the second way you can:

3. Finally, where the test message again

 

Published 86 original articles · won praise 21 · views 30000 +

Guess you like

Origin blog.csdn.net/xbw_linux123/article/details/104679717