How To Set the SMTP Timeout in Confluence

Still need help?

The Atlassian Community is here for you.

Ask the community

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

  1. Stop Confluence

  2. Back up your Confluence database

  3. Run the following query on the database: 

    SELECT * FROM BANDANA WHERE BANDANAKEY = 'atlassian.confluence.smtp.mail.accounts';
  4. Find the following in the BANDANAVALUE:

    <property name="mail.smtp.timeout" value="10000"/>

    and

    <property name="mail.smtp.connectiontimeout" value="10000"/>
  5. 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.

  6. Restart Confluence

Last modified on Dec 9, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.