diff options
Diffstat (limited to 'app/models/mail_handler.rb')
-rwxr-xr-x | app/models/mail_handler.rb | 3 |
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 |