How To Set the SMTP Timeout in Confluence
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Purpose
For some environments, it may be necessary to update the SMTP Timeout in Confluence. This can be done through SQL query.
There is a feature request to add this functionality to the UI, which can be found here: CONF-34844 - Getting issue details... STATUS
Solution
Stop Confluence
Back up your Confluence database
Run the following query on the database:
SELECT * FROM BANDANA WHERE BANDANAKEY = 'atlassian.confluence.smtp.mail.accounts';
Find the following in the BANDANAVALUE:
<property name="mail.smtp.timeout" value="10000"/>
and
<property name="mail.smtp.connectiontimeout" value="10000"/>
Use SQL's REPLACE function to increase the values
EXAMPLE:UPDATE BANDANA SET BANDANAVALUE = replace(BANDANAVALUE,'<property name="mail.smtp.connectiontimeout" value="10000"/>','<property name="mail.smtp.connectiontimeout" value="20000"/>') WHERE BANDANAVALUE LIKE '%mail.smtp.connectiontimeout%'; UPDATE BANDANA SET BANDANAVALUE = replace(BANDANAVALUE,'<property name="mail.smtp.timeout" value="10000"/>','<property name="mail.smtp.timeout" value="20000"/>') WHERE BANDANAVALUE LIKE '%mail.smtp.timeout%';
For MS SQL the update statements are:
UPDATE BANDANA SET BANDANAVALUE = CAST(REPLACE(CAST(BANDANAVALUE as nvarchar(max)),'<property name="mail.smtp.timeout" value="10000"/>','<property name="mail.smtp.timeout" value="20000"/>') as ntext) WHERE BANDANAVALUE LIKE '%mail.smtp.connectiontimeout%'; UPDATE BANDANA SET BANDANAVALUE = CAST(REPLACE(CAST(BANDANAVALUE as nvarchar(max)),'<property name="mail.smtp.connectiontimeout" value="10000"/>','<property name="mail.smtp.connectiontimeout" value="20000"/>') as ntext) WHERE BANDANAVALUE LIKE '%mail.smtp.timeout%';
Also note: If email settings are updated, the settings will revert to the default. You will need to reproduce these steps after the change has been made.
- Restart Confluence