How to retrieve or update mail servers password from the Jira database
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs 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
Summary
This article gives guidance on how you can retrieve or update mail server password from the Jira database
Environment
Jira Core 8.12.x onwards
Jira Software 8.12.x onwards
Jira Service Management 4.12.x onwards
Solution
The below is stated in the above articles
Database password encryption
We're now using Base64 encoding to encode all new and existing mail server passwords. As a result the mailpassword field isn't plain text any longer.
To retrieve the plaintext password, you first run the below query to retrieve the encoded password. You can then decode the password using any decoder of your choice, for example: https://www.base64decode.org/
1
SELECT mailpassword FROM mailserver WHERE name = '<mail server name in Jira>';
To update the password directly in the database, you will first need to encode your password with base64 encoding. You can use any encoder of your choice, for example: https://www.base64encode.org/
1
UPDATE mailserver SET mailpassword='<base64-encoded password>' WHERE name = '<mail server name in Jira>';
This is only for authenticated SMTP which is not configured through the server.xml
Other mails settings like JNDI also store the password in server.xml
Was this helpful?