Error 'Mail is disabled' while trying to use my Custom Mail Handler plugin

Hi colleagues. ;)

I'm trying to write Custom Mail Handler for creating/modifying issues according to contents of notifications sent by mail. I want to process contents of mail contents with my own code.

 

I went through atlassian tutorial. Tried to simplify things and added only one component (java class). This Java class implements MessageHandler interface.

I'm testing this plugin on localhost:2990/jira (2990 port).

 

But mail handler doesn't work and return this error in command line:

 [INFO] [talledLocalContainer] 2017-12-05 13:18:39,213 Caesium-1-1 INFO anonymous    CompanyName Support Robot [c.a.mail.incoming.mailfetcherservice] CompanyName Support Robot[10001]: Mail is disabled.

 Mail handler doesn't work and doesn't delete message from mail box.

 

I also tried code from (used all files for plugin): 

git clone https://bitbucket.org/atlassian_tutorial/jira-add-email-handler.git

->Same problem.

my java class (modifyed for security reason):

package com.company.plugin.companynamemailhandler;

import com.atlassian.jira.bc.issue.IssueService;
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.IssueInputParameters;
import com.atlassian.jira.service.util.handler.MessageHandler;
import com.atlassian.jira.service.util.handler.MessageHandlerContext;
import com.atlassian.jira.service.util.handler.MessageHandlerErrorCollector;
import com.atlassian.jira.user.ApplicationUser;

import java.util.Map;
import javax.mail.Message;
import javax.mail.MessagingException;

import com.atlassian.jira.user.UserUtils;
import com.atlassian.mail.MailUtils;


public class CompanyNameHandler implements MessageHandler {

//author of issues
private String userName = "admin";

@Override
public void init(Map<String, String> params, MessageHandlerErrorCollector monitor) {
//There is no any code inside this method
}


@Override
public boolean handleMessage(Message message, MessageHandlerContext context) throws MessagingException {

//In this part of program im creating issue and comment based on incoming mail.
//Deleted for security reason.

return true;
}
}

 

Please help me to solve this :) I'm already ill from debugging and don't really know how to bread through this issue.

I'm using jira 7.5.2 and my mail box is on gmail, sending also from gmail.

 

Thank's in advance.

1 answer

Hi. I found workaround that works for me. 

1. When i'd like to test my plugin I run "atlas-mvn package" from command line.

2. Upload my plugin from target folder

(for example "C:\Program Files\Atlassian\Application Data\JIRA\plugins\mail-handler-demo\target")

to my original jira instance and test.

 

I tryed a lot of stuff, but this is the only way for me.  

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

344 views 1 18
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