diff options
author | Go MAEDA <maeda@farend.jp> | 2019-02-18 13:51:26 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2019-02-18 13:51:26 +0000 |
commit | 514e8b9112dca74ad82bc24eb55ef258ae47fa97 (patch) | |
tree | 908c4d1bebf5c47ebf3c5cc1c0d1f96cc9e55d4a /app | |
parent | 222546ad6ef625ffc6387154638f30fa67a2f8d4 (diff) | |
download | redmine-514e8b9112dca74ad82bc24eb55ef258ae47fa97.tar.gz redmine-514e8b9112dca74ad82bc24eb55ef258ae47fa97.zip |
Merged r17878 and r17879 from trunk to 4.0-stable (#30785).
git-svn-id: http://svn.redmine.org/redmine/branches/4.0-stable@17880 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rwxr-xr-x | app/models/mail_handler.rb | 3 | ||||
-rw-r--r-- | app/models/setting.rb | 6 |
2 files changed, 2 insertions, 7 deletions
diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb index 6586c52bb..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_address) == 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 diff --git a/app/models/setting.rb b/app/models/setting.rb index e6de85906..e59c48c86 100644 --- a/app/models/setting.rb +++ b/app/models/setting.rb @@ -228,12 +228,6 @@ class Setting < ActiveRecord::Base Object.const_defined?(:OpenID) && self[:openid].to_i > 0 end - # Extracts an email address ("joe@example.com") from - # Setting.mail_from ("Joe Bloggs <joe@example.com>") - def self.mail_from_address - self.mail_from.to_s.gsub(/(?:.*<|>.*|\(.*\))/, '').strip - end - # Checks if settings have changed since the values were read # and clears the cache hash if it's the case # Called once per request |