Prepare a Jira development server's mail configuration
What is the problem?
When you bring up a development instance of Jira, it is important to test your mail settings. However, if you bring up an identical copy of your running instance, you can have a recipe for disaster as it could result in incoming emails being parsed by your development instance, or erroneous notifications going out to users that do not understand what is going on. Extreme cases have resulted in system outages.
If you have multiple Jira instances using the same mailbox, the dev instance can end up processing mails that should be going to production. This means issues and comments can be added to the development server instead of production and also dev can send out notifications.
How do we prevent it?
Follow these steps to get a dev instance up and running with no rogue email issues:
- Backup your existing instance as in our Backing Up docs.
- Before restoring the XML data into your staging Jira instance, please disable the mail handlers, as in our disabling emailing documentation.
This will require a restart of Jira. If you've used one of the bundled installers, it will automatically start Jira up without these settings. Please ensure to restart Jira after making these changes.
- After restarting Jira and disabling email, import your production Jira data.
- Delete all of the existing mail handlers.
- Delete all existing SMTP and IMAP / POP servers.
- Shut down the instance.
Remove all the filter subscriptions with the following SQL:
delete from filtersubscription;
skip this if you need to test filter subscriptions. Just make sure to do step 11 to ensure that your users do not get spammed.
Remove the following entries:
delete from notificationinstance;
- As all references to the production mail servers have been removed, you can now revert the changes in step 2 and restart Jira.
- Add the necessary development mail server configuration for testing.
To ensure that no emails go out to regular users during your testing, we recommend creating a dummy email address which you can use to verify that notifications are going to the right place. Then update all user emails to point to the same place using this query:
update cwd_user set firstname.lastname@example.org', email@example.com';
Replace all property entries which contain emails with one of your choice:
update propertystring set propertyvalue ='firstname.lastname@example.org' where id in (select pe.id from propertyentry pe where pe.property_key='jira.project.email.sender');