The mail notification settings are not stored in a configuration property, and it is not possible to easily disable them.
Use cases for this request
Every day a backup of the production instance is copied to a disaster recovery site. When the application is started in the disaster recovery environment, the batch emails (not yet processed) are sent from both the main production and the disaster recovery environment causing duplicated emails to be received.
We have a staging server that we use to test updates to Bitbucket Server. We clone from production but don't want the staging clone to send (duplicate) emails.
Provide a configuration property to disable the mail notification, so that this setting can be set independently on the main production and on the disaster recovery site.
provides the -Datlassian.mail.senddisabled=true option.