summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-11-18 23:09:45 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-11-18 23:09:45 +0000
commita829bfa75578e7025272de9371e81192ab651fa7 (patch)
tree6c68e0b3018c69ea3b99cf094ce1ec005f9f3c18 /app
parentf232f56d97408a8677ee505081d2852d32f12a31 (diff)
downloadredmine-a829bfa75578e7025272de9371e81192ab651fa7.tar.gz
redmine-a829bfa75578e7025272de9371e81192ab651fa7.zip
Fixed that MailHandler raises an error when email has no subject header (#12396).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10850 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/models/mail_handler.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb
index 3da93852d..b6cb2ac47 100644
--- a/app/models/mail_handler.rb
+++ b/app/models/mail_handler.rb
@@ -124,6 +124,7 @@ class MailHandler < ActionMailer::Base
def dispatch
headers = [email.in_reply_to, email.references].flatten.compact
+ subject = email.subject.to_s
if headers.detect {|h| h.to_s =~ MESSAGE_ID_RE}
klass, object_id = $1, $2.to_i
method_name = "receive_#{klass}_reply"
@@ -132,9 +133,9 @@ class MailHandler < ActionMailer::Base
else
# ignoring it
end
- elsif m = email.subject.match(ISSUE_REPLY_SUBJECT_RE)
+ elsif m = subject.match(ISSUE_REPLY_SUBJECT_RE)
receive_issue_reply(m[1].to_i)
- elsif m = email.subject.match(MESSAGE_REPLY_SUBJECT_RE)
+ elsif m = subject.match(MESSAGE_REPLY_SUBJECT_RE)
receive_message_reply(m[1].to_i)
else
dispatch_to_default