summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2019-02-18 13:21:18 +0000
committerGo MAEDA <maeda@farend.jp>2019-02-18 13:21:18 +0000
commitb41c5c89d482225b1252dfcd7d700c505f2afc03 (patch)
treeca6a5d86348566337297818cc345dc2601450474 /app
parent5329ef3b826d9cb291951abf1b602e48732dddce (diff)
downloadredmine-b41c5c89d482225b1252dfcd7d700c505f2afc03.tar.gz
redmine-b41c5c89d482225b1252dfcd7d700c505f2afc03.zip
Mail handler does not ignore emails sent from emission email address if Setting.mail_from includes display name (#30785).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@17879 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rwxr-xr-xapp/models/mail_handler.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb
index 9298e1b12..be4b363b1 100755
--- a/app/models/mail_handler.rb
+++ b/app/models/mail_handler.rb
@@ -91,7 +91,8 @@ class MailHandler < ActionMailer::Base
@handler_options = options
sender_email = email.from.to_a.first.to_s.strip
# Ignore emails received from the application emission address to avoid hell cycles
- if sender_email.casecmp(Setting.mail_from.to_s.strip) == 0
+ emission_address = Setting.mail_from.to_s.gsub(/(?:.*<|>.*|\(.*\))/, '').strip
+ if sender_email.casecmp(emission_address) == 0
if logger
logger.info "MailHandler: ignoring email from Redmine emission address [#{sender_email}]"
end