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

Andrij December 5, 2017

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.

0 answers

Suggest an answer

Log in or Sign up to answer