プロジェクト

全般

プロフィール

Vote #79943

未完了

How to disable email subject processing

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Resolved
優先度:
通常
担当者:
-
カテゴリ:
Email receiving_29
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
29
version_id:
0
issue_org_id:
31107
author_id:
393065
assigned_to_id:
0
comments:
3
status_id:
3
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Resolved]

説明

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


journals

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.

<pre><code class="diff">
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
</code></pre>
--------------------------------------------------------------------------------
Ok, I will try it. Thanks and regards.
--------------------------------------------------------------------------------
Hello,

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

<pre>
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
</pre>

Christof
--------------------------------------------------------------------------------

Admin Redmine さんが約4年前に更新

  • カテゴリEmail receiving_29 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0