Debug disabled outgoing mail

Hi everybody!

It seems, if the outgoing mail in a JIRA instance is disabled, JIRA will write no logging output for the outgoing mail. Is there any way I can achieve this?

My scenario is this: I have a development instance of JIRA running and am doing a weekly synchronization with our main instance, for testing purposes. Obviously, the outgoing email is disabled (on startup, via for this development instance, otherwise people would receive emails from it, e.g. for their subscribed filters that are transferred in the synchronization.

Now, I want to do some testing on notifications on the development instance. I thought that just enabling the debugging on outgoing mail ("Logging and Profiling" or via "-Dmail.debug=true" on startup) would log the outgoing mail, even if they are not sent. This would be ideal to check what notifications are sent to whom. Apparently, this is not the case. I can see the notification turning up and disappearing in JIRA's mail queue, but no log is written for it.

So, here are my two questions:

  1. It this on purpose? Or am I doing something wrong? Is the outgoing mail log really only written on connection to the SMTP server, and not on emptying the mail queue?
  2. Does anybody know a good way to test notifications without actually sending out emails to JIRA users?

Any help is appreciated, thanks in advance,


1 answer

1 accepted

1 vote
Answer accepted

No, the "mail disabled" flag kills off the mail well before sending it.  You can't log what you aren't doing.

The usual trick we use is to set up the test system with the email disabled, then install a local mail server (simple postfix will do it), configure that not to forward any mail at all, just quietly bin it all, point the test system at it and re-enable the mail.

Wow, thanks Nic! This was very fast, understandable and helpful!

If there was no such option within JIRA, I would have planned on wrecking the SMTP-settings in the test instance and then just logging the errors, but this is way more elegant.

I am guessing I will have to patch the database before startup, after synchronization from the main instance, to replace the SMTP server settings, right? We are doing this anyways to replace all license keys with the development licenses, so this is no significant overhead. smile

Cheers and greetings from Germany!

I've always done it by hand, so I don't know where to look in the database.   But yes, you should be able to replace mailserver:port with localhost:port

One additional advantage is you can also do additonal logging on the mail side without affecting production, you're not restricted to JIRA's logs

Very true.

In case anybody stumbles across this in the future: Replacing the license keys was a bit of a hassle, but the mail server info is easy: It is just stored in the obvious database table "dbo.mailserver", which contains one line with all the info entered in the JIRA mask. smile So this would be something like:

UPDATE dbo.mailserver
	SET SERVERNAME = "localhost"
	WHERE NAME = "YourServerName"

You could obviously also update other fields like the mailusername and mailpassword if needed, or even the port or protocol...

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 09, 2018 in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

386 views 6 0
Join discussion

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