summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xapp/models/mail_handler.rb2
-rw-r--r--test/unit/mail_handler_test.rb11
2 files changed, 12 insertions, 1 deletions
diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb
index 5590534d9..239033953 100755
--- a/app/models/mail_handler.rb
+++ b/app/models/mail_handler.rb
@@ -286,7 +286,7 @@ class MailHandler < ActionMailer::Base
reply
else
if logger
- logger.info "MailHandler: ignoring reply from [#{sender_email}] to a locked topic"
+ logger.info "MailHandler: ignoring reply from [#{email.from.first}] to a locked topic"
end
end
end
diff --git a/test/unit/mail_handler_test.rb b/test/unit/mail_handler_test.rb
index 79405b5d6..2c7a1c1da 100644
--- a/test/unit/mail_handler_test.rb
+++ b/test/unit/mail_handler_test.rb
@@ -955,6 +955,17 @@ class MailHandlerTest < ActiveSupport::TestCase
assert_equal Message.find(1), m.parent
end
+ def test_reply_to_a_locked_topic
+ # Lock the topic
+ topic = Message.find(2).parent
+ topic.update_attribute :locked, true
+
+ assert_no_difference('topic.replies_count') do
+ m = submit_email('message_reply_by_subject.eml')
+ assert_not_kind_of Message, m
+ end
+ end
+
def test_should_convert_tags_of_html_only_emails
with_settings :text_formatting => 'textile' do
issue = submit_email('ticket_html_only.eml', :issue => {:project => 'ecookbook'})