Is there a command to flush email queue?

Mike Ellis June 13, 2012

Working an email problem with Atlassian at this time (see JSP-129280). The problem basically is that JIRA has stopped sending emails according to the schedule and all emails must be manually flushed. To do this I must be logged into the Admin section of JIRA and continually monitor the Mail Queue. Is there a command I can run from the command line to flush the queue so I don't have to flush it from the GUI? Otherwise email is working just fine, just the scheduler has stopped working (I have a feeling a restart of JIRA is in order but waitin for Atlassian to finish their investigation first!).

I am running JIRA 4.2 on Solaris 10 and figured I could set a cron job to run every so often if there is a way from the command-line to flush the mail queue. I have looked through some of the Answers here as well as some Atlassian docs, but none of the fixes apply in this case, I have not seen any Out of Memory Errors or "IllegalArgumentException: Passed List had more than one value" problems.

Thanks in advance for the help!

3 answers

1 vote
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.
June 13, 2012

No. There's no "command line" in Jira you could use.

Bob Swift's "Command line plugin" does allow us to pretend that there is (and it does an excellent job, especially if you're scripting), but I don't think it has a "flush mail queue" function.

The best dirty hack I can think of is to find a unix box and whack a cron job on it that uses curl or wget to hit the "flush mail queue" url regularly with an admin account's credentials. I'm uncomfortable with the security on that, but it'll work.

By the way, we non-Atlassian bods can't see JSP issues - they're private, between the Customer and Atlassian

Mike Ellis June 13, 2012

I forgot this Issue was under lock-and-key, sorry about that.

I do not feel comforable with curl or wget as you described either, but heck of great idea! I think I will just have to not be lazy and just remember to hit the "Flush Queue" more often. I am going to look into the "Command line plugin" though, sounds interesting....

Thanks for the help!

HP November 25, 2014

Is there anyone manage to create a script to flush mail queue and schedule it as cron task? Thanks!

0 votes
Mike Ellis June 14, 2012

JIRA was restarted this evening and this has cleared the problem, I am now seeing email again from JIRA without having to manually flush the queue.

Please forgive me for being the new guy but I like both the answers I got, Jo-Ann's was actually correct but Nic gave me great advice. How do I give both some credit? I will keep looking on the forums to see if I can find my own answer to this...

0 votes
Jo-Anne MacLeod
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.
June 13, 2012

I ran into this problem before. A restart of JIRA did resolve the issue.

Mike Ellis June 13, 2012

Yeah, figured that would help, looks like Atlassian wants me to do a little more house-cleaning before restarting though, we just went through a mail migration so the fallout has not been completely sorted yet.

Thanks for the insight!

Suggest an answer

Log in or Sign up to answer