Disable email notification from Stash

Hey,

I need to disable emails in a newly setup Staging instance.

What I have understood there is no setting for this in the startup parameters (like it is for JIRA) so I guess it must be done on db-level (as for Confluence)

Would it be enough just to clear the "mail.host" property key in the app_property table in the Stash database?

UPDATE app_property SET prop_value = ''
WHERE
prop_key = 'mail.host'

I tried this and it seems to work out as expected! A re-start was needed though.

Any comments about this approach?

Thnx in advance!

// Svante

3 answers

This widget could not be displayed.

In the newer versions of Stash there's actually a jira-like panel to setup/modify mail handlers. Are you on an older version, or is there a reason you're doing it differently? Something with how your import process may be working?

This widget could not be displayed.

Hi Andrew, I have tried this on both 2.11+ and the newest 3.4 and it seems to work the same. I know about the Mail Configuration section in the admin UI and that this is the place to turn off any outgoing emails. But I want to ensure this to be disabled prior to start-up of the new instance. My process for creating a Staging instance is (so far) 1. Backup my production instance using the Backup Client 2. Install the same Stash version on the Staging server 3. Restore this backup onto a Staging server using a new database 4. Update a bunch of files to not interfere with the original instance At this point I can now fire up the staging instance, but ... This could potentially still interfere with my production environment so I ... 5. Disable ALL post-function hooks in the database (typically Jenkins-stuff, web-hooks, REST-hooks) 6. Disable outgoing email. If this instance sends out emails it would be very confusing for the users. Now it should be safe(r) to start-up the staging environment. Maybe I make too much fuzz about this. I could just start-up the instance and as my first task just go into the Email Configuration in the admin UI and turn it off. But I like to make sure nothing is forgotten when creating a staging environment. At some point I will get disturbed in the process and forget to turn it off. This cannot happen and therefore I want to have it as a toll-gate prior to start-up. Makes sense? Cheers, // Svante

This widget could not be displayed.

Hi Svante,

Stash does not have a startup parameter that you can use, but you could use the REST api to quickly clear out the mail configuration after startup. Just send a DELETE to /rest/api/latest/admin/mail-server. You'll need to be SYS_ADMIN to do it though.

See https://developer.atlassian.com/static/rest/stash/3.4.0/stash-rest.html#idp3190336 for the full documentation.

Cheers,

Michael

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 21, 2018 in Bitbucket

Branch Management with Bitbucket

As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...

1,207 views 8 11
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you