How to set Outgoing Mail DISABLED by edit DB?

xinan liu October 22, 2015

I restore the DB form JIRA B to JIRA A by SQL server.

Then I want to set the JIRA A's outgoing mail to disable automaticly.

I think this setting was store in the DB. So how to set Outgoing Mail DISABLED by edit DB?

Thanks very much!

2 answers

2 votes
Daniel Faba
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 22, 2015

Hi xinan, as Nic said, it is recommended not to change values directly in JIRA database.

Anyway, if you really need to do it this way, you'll need to execute the following query and restart your JIRA instance:

UPDATE propertynumber SET propertyvalue=1 WHERE ID=(SELECT ID FROM propertyentry WHERE ENTITY_NAME='jira.properties' AND ENTITY_ID=1 AND PROPERTY_KEY='jira.mail.send.disabled');

Regards

WHF_Engineering February 26, 2021

Looks pretty simple to me.  Pretty basic sub-select.  If he's like me, he's doing it in a test or development environment prior to Jira startup, so what's the risk?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 26, 2021

With this particular database hack there are two main risks

1.  It probably won't work.  It certainly won't work without restarting, and if you're doing that, you might as well do it the supported way, as it's quicker, safer and more reliable.

2.  It encourages people to do things in the database.  Which is a very very bad thing.

2 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 22, 2015

It is strongly recommended that you do NOT change the database in JIRA.  It's not as simple as people seem to think it is.

Use the command line flags to start JIRA A instead - see https://confluence.atlassian.com/jira/setting-properties-and-options-on-startup-120007.html ( i.e. -Datlassian.mail.senddisabled -Datlassian.mail.fetchdisabled -Datlassian.mail.popdisabled )

crf
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 24, 2015

These options are already present but commented out in in the setenv.sh and setenv.bat that ship with JIRA. I would simply uncomment them rather than trying to do anything fancy. In setenv.bat: rem -------------------------------------------------------------------------- rem Uncomment this setting if you want to import data without notifications rem rem -------------------------------------------------------------------------- rem set DISABLE_NOTIFICATIONS= -Datlassian.mail.senddisabled=true -Datlassian.mail.fetchdisabled=true -Datlassian.mail.popdisabled=true In setenv.sh: # Uncomment this setting if you want to import data without notifications # #DISABLE_NOTIFICATIONS=" -Datlassian.mail.senddisabled=true -Datlassian.mail.fetchdisabled=true -Datlassian.mail.popdisabled=true"

Like Nic Brough -Adaptavist- likes this
Gaurav Arora September 13, 2019

@Nic Brough -Adaptavist- ,

Could you please tell me how to uncomment the lines in the setenv.bat file.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 13, 2019

Remove the "this is a comment" indicator character(s) from the beginning of each line you want to enable.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events