Project

General

Profile

Actions

Defect #7195

closed

Apply CLI-supplied defaults for incoming mail only to new issues not replies

Added by Felix Schäfer about 13 years ago. Updated about 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Email receiving
Target version:
Start date:
2010-12-29
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Replying to an issue mail used to ignore default parameters passed to the mail-handling rake task, or to be precise did only care for other parameters than those we pass on the command line. The refactorings in r4394 changed that though, and now replies to "issue mails" re-apply the defaults passed on the CLI, which I don't think is something that should happen.

Example:

  1. Create a new issue, say in the tracker "Bug"
  2. Write a reply to the mail you just got for that issue, the mail gets imported with: rake redmine:email:receive_imap … tracker=Support
  3. The tracker of the issue gets changed to "Support"

Related issues

Related to Redmine - Defect #30070: Unable to update assignee with rdm-mailhandler.rbClosed

Actions
Actions #1

Updated by Felix Schäfer about 13 years ago

The following fix is not elegant but does the job:

diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb
index 8925e4e..1aa3ff9 100644
--- a/app/models/mail_handler.rb
+++ b/app/models/mail_handler.rb
@@ -150,6 +150,9 @@ class MailHandler < ActionMailer::Base
     unless @@handler_options[:no_permission_check]
       raise UnauthorizedAction unless user.allowed_to?(:add_issue_notes, issue.project) || user.allowed_to?(:edit_issues, issue.project)
     end
+
+    # ignore CLI-supplied defaults for new issues
+    @@handler_options[:issue].clear

     journal = issue.init_journal(user, cleaned_up_text_body)
     issue.safe_attributes = issue_attributes_from_keywords(issue)
Actions #2

Updated by Jean-Philippe Lang about 13 years ago

  • Target version set to 1.1.0
Actions #3

Updated by Jean-Philippe Lang about 13 years ago

  • Status changed from New to Closed
  • Resolution set to Fixed

Fixed with test in r4576.

Actions #4

Updated by Go MAEDA over 5 years ago

  • Related to Defect #30070: Unable to update assignee with rdm-mailhandler.rb added
Actions

Also available in: Atom PDF