Details
-
Suggestion
-
Resolution: Unresolved
-
None
-
None
-
2
-
3
-
Description
Problem Definition
Not possible to add connection timeout to SMTP mail configuration in the Administration
Suggested Solution
Add a new connection timeout setting for SMTP mail configuration in the Administration
Why this is important
- There is no need to restart Bamboo (when using the workaround) if mail configuration need to be changed
- No need to add JNDI in the new server.xml file when upgrading Bamboo
Workaround
For Bamboo versions prior to 6
- Shutdown Bamboo
- Copy the file <bamboo-install>\atlassian-bamboo\WEB-INF\lib\javax.mail-*.jar into <bamboo-install>\lib
- Delete <bamboo-install>\atlassian-bamboo\WEB-INF\lib\javax.mail-*.jar
- Edit the file <bamboo-install>\conf\server.xml to add the following SMTP settings (Resource tag only):
<Context path="" docBase="${catalina.home}/atlassian-bamboo" reloadable="false" useHttpOnly="true"> <Resource name="mail/SmtpServer" auth="Container" type="javax.mail.Session" mail.smtp.host="smpt.host.name" mail.smtp.port="25" mail.smtp.auth="true" mail.smtp.user="username" password="password" mail.transport.protocol="smtp" mail.smtp.connectiontimeout="20000" /> <!--<Resource name="UserTransaction" auth="Container" type="javax.transaction.UserTransaction"--> <!--factory="org.objectweb.jotm.UserTransactionFactory" jotm.timeout="60"/>--> <Manager pathname=""/> </Context>
- Start Bamboo
- Edit the mail setting at Administration >> Communication >> Mail server
- Select the option “JNDI” in “Email settings”
- Fill in the value “java:comp/env/mail/SmtpServer” in “JNDI location”
- Save the settings
For Bamboo 6 onwards:
The workaround process is the same, but for steps 2 and 3, 2 libraries must be moved instead of one:
- javax.mail-api-x.x.x.jar
- javax.mail-X.X.X.jar