Project

General

Profile

Actions

Feature #31107

open

How to disable email subject processing

Feature #31107: How to disable email subject processing

Added by Daniel Arnost over 7 years ago. Updated about 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Email receiving
Target version:
-
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

Updated by Go MAEDA over 7 years ago Actions #1

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

Updated by Daniel Arnost over 7 years ago Actions #2

  • Status changed from New to Resolved

Ok, I will try it. Thanks and regards.

Updated by Christof Egner about 7 years ago Actions #3

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: PDF Atom