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
setenv.sh) 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:
Any help is appreciated, thanks in advance,
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.
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
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. So this would be something like:
UPDATE dbo.mailserver SET SERVERNAME = "localhost" WHERE NAME = "YourServerName"
You could obviously also update other fields like the
mailpassword if needed, or even the port or protocol...
If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...
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!
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
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot