diff options
author | Matthew Landauer <matthew@openaustralia.org> | 2012-10-11 12:51:31 +1100 |
---|---|---|
committer | Matthew Landauer <matthew@openaustralia.org> | 2012-10-11 12:53:52 +1100 |
commit | 14d84bd536883b2f10ed5c6ff4aaec4edfd17b0f (patch) | |
tree | 96625697cef358fa354abf08a6a88bc0e86599a2 /app/models/mail_server_log.rb | |
parent | 23f9e3fe84e33234cdec8f61775a847a23f92a2f (diff) |
Ignore emails in logs with incorrect prefixes
Diffstat (limited to 'app/models/mail_server_log.rb')
-rw-r--r-- | app/models/mail_server_log.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/mail_server_log.rb b/app/models/mail_server_log.rb index f220132cb..8a978ae07 100644 --- a/app/models/mail_server_log.rb +++ b/app/models/mail_server_log.rb @@ -120,8 +120,10 @@ class MailServerLog < ActiveRecord::Base m[1] if m end + # We also check the email prefix so that we could, for instance, separately handle a staging and production + # instance running on the same server with different email prefixes. def MailServerLog.email_addresses_on_line(line) - line.scan(/request-[^\s]+@#{Configuration::incoming_email_domain}/).sort.uniq + line.scan(/#{Regexp::quote(Configuration::incoming_email_prefix)}request-[^\s]+@#{Configuration::incoming_email_domain}/).sort.uniq end def MailServerLog.request_sent?(ir) |