Setting Up a Mail Session for the Confluence Distribution? 設(shè)置Confluence分發(fā)的郵件會(huì)話Set up a mail session for the Confluence distribution to use Gmail as follows:
1祭往,Stop Confluence.? ? Stop
2伦意,Move (don't copy) activation-1.0.2.jar and mail-1.4.1.jar from/confluence/WEB-INF/lib to/<confluence-install>lib.? ? 移動(dòng)而不是復(fù)制
3,Add the following to your server.xml file found in<confluence-install>/conf/ (add it just before the? </Context>tag):?
注意:<context></context>里面硼补。 </context>標(biāo)簽之前添加一下信息
<Resource name="mail/QqSMTPServer"
auth="admin"
type="javax.mail.Session"
mail.smtp.host="smtp.exmail.qq.com"
mail.smtp.port="465"
mail.smtp.auth="true"
mail.smtp.user="xxxxx@qq.com"
password="yourPassword"
mail.smtp.starttls.enable="true"
mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"
/>
4驮肉,Restart Confluence.? ? ? restart
5,Choose the cog icon? at top right of the screen, then choose Confluence Admin.
6已骇,Choose Mail Servers.
7离钝,Choose either Edit an existing configuration, or Add a new SMTP mail server.登錄添加郵件配置
8,Edit the server settings as necessary, and set the JNDI Location as:? 添加JNDI的位置? ? JNDI: java:comp/env/mail/QqSMTPServer
Note : that the JNDI Location is case sensitive and must match the resource name specified in server.xml.? ? JNDI嚴(yán)重區(qū)分大小寫,并且必須與server.xml中指定的資源名稱匹配褪储。
9卵渴,Submit, and send a test email.? 發(fā)送郵件測(cè)試.
Atlassian Document: https://confluence.atlassian.com/conf51/setting-up-a-mail-session-for-the-confluence-distribution-336169679.html?
寫一下我遇到的一些問題:
1,server.xml文件保存的時(shí)候另存為要選擇格式為UTF-8.因?yàn)橛锌赡苡袝r(shí)候會(huì)報(bào)錯(cuò).
2,添加的郵件信息一定是在<context></context>里面,而不是外面.
3,移動(dòng)mail-1.4.1.jar文件時(shí),還有一個(gè)atlassian-mail-1.4.1.jar這個(gè)文件是不需要移動(dòng)的.
4,com.atlassian.mail.MailException: javax.naming.NameNotFoundException: Name mail is not bound in this Context 參見2