How To Set the SMTP Timeout in Confluence

Still need help?

The Atlassian Community is here for you.

Ask the community

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 Apr 22, 2022

Was this helpful?

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