Project

General

Profile

Actions

Feature #31107

open

How to disable email subject processing

Added by Daniel Arnost almost 6 years ago. Updated over 5 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Email receiving
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

Hello!
We run redmine 2.4.2 and use rdm-mailhandler. It works well until new email arrives with subject containing "[#123"]. This string mostly does not belong to redmine issue - it is from another ticket system and we need always to create new issue from that email. Unfortunately, as is written, the email is processed as a reply for [#123]. And if redmine can not find existing issue #123, email is returned and no new issue is created.

Is any chance to disable this email subject processing for selected project/mail-handler?

Thanks,
dan

Actions #1

Updated by Go MAEDA almost 6 years ago

There is no option to disable the feature that adds replies in the mail handler, but maybe you can remove the feature by changing the code as follows.

diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb
index 52faef135..f721a2314 100755
--- a/app/models/mail_handler.rb
+++ b/app/models/mail_handler.rb
@@ -168,10 +168,6 @@ class MailHandler < ActionMailer::Base
       else
         # ignoring it
       end
-    elsif m = subject.match(ISSUE_REPLY_SUBJECT_RE)
-      receive_issue_reply(m[1].to_i)
-    elsif m = subject.match(MESSAGE_REPLY_SUBJECT_RE)
-      receive_message_reply(m[1].to_i)
     else
       dispatch_to_default
     end
Actions #2

Updated by Daniel Arnost almost 6 years ago

  • Status changed from New to Resolved

Ok, I will try it. Thanks and regards.

Actions #3

Updated by Christof Egner over 5 years ago

Hello,

I would suggest the following changes to the code in order to make redmine ignore alien issue id:

172c172,178
<       receive_issue_reply(m[1].to_i)
---
>       issue = Issue.find_by_id(m[1].to_i)
>       if issue
>         receive_issue_reply(issue.id)
>       else
>         logger.error "MailHandler: Invalid issue id ##{m[1].to_i}; dispatch_to_default" if logger
>         dispatch_to_default
>       end

Christof

Actions

Also available in: Atom PDF