调整confluence服务

  • confluence安装目录下的server.xml中加一段邮件服务器的配置,加在confluenceContext
<Context path="" docBase="../confluence" debug="0" reloadable="false" useHttpOnly="true">
<!-- Logging configuration for Confluence is specified in confluence/WEB-INF/classes/log4j.properties -->
<Manager pathname=""/>
<Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="60"/>
<!--QQ企业邮箱配置-->
<Resource name="mail/QqSMTPServer"
auth="Container"
type="javax.mail.Session"
mail.smtp.host="QQ企业邮箱SMTP地址"
mail.smtp.port="465"
mail.smtp.auth="true"
mail.smtp.user="邮箱登陆账号"
password="邮箱密码"
mail.smtp.starttls.enable="true"
mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"
/>
</Context>
  • 下载javamailjar
mkdir -p /opt/upload/mail-jar/ && cd /opt/upload/mail-jar
wget 'https://maven.java.net/content/repositories/releases/com/sun/mail/javax.mail/1.6.1/javax.mail-1.6.1.jar'
wget 'https://maven.java.net/content/repositories/releases/javax/mail/javax.mail-api/1.6.1/javax.mail-api-1.6.1.jar'
wget 'https://maven.java.net/content/repositories/releases/com/sun/mail/mailapi/1.6.1/mailapi-1.6.1.jar'
wget 'https://maven.java.net/content/repositories/releases/com/sun/mail/smtp/1.6.1/smtp-1.6.1.jar'
cp * /opt/conflucence安装目录/lib/
cd  /opt/conflucence安装目录/confluence/WEB-INF/lib
rm -f mail-1.4.5.jar
  • 重启confluence
/etc/init.d/confluence restart

confluence中配置邮箱

  • 进入邮件服务器配置界面

image.png

  • 填写JNDI:java:comp/env/mail/QqSMTPServer,这个JDIN对应你在server.xml中添加的配置

image.png

配置完成后,点击【提交】

测试发送邮件

  • 点击【发送测试邮件】

image.png

如图

image.png

Q.E.D.


所以,看不到光,算是不幸吗?需要光才是真正的不幸吧。