aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Landauer <matthew@openaustralia.org>2012-10-12 09:18:38 +1100
committerMatthew Landauer <matthew@openaustralia.org>2012-10-12 09:18:38 +1100
commite2ab4e00cb95a63f8306893b68f87e72d3016e25 (patch)
tree794b1999b3993da49f8fe3ee257c32fee10baf85
parent5857df84f44e1290fde7320649caab41689d775c (diff)
Revert "Also allow arbitrary subdomain on email addresses picked up in the logs"
This reverts commit 9ae51d5ff6a9f56fd1bd4ba4bdd84bfd43ac6d95.
-rw-r--r--app/models/mail_server_log.rb6
-rw-r--r--spec/models/mail_server_log_spec.rb5
2 files changed, 1 insertions, 10 deletions
diff --git a/app/models/mail_server_log.rb b/app/models/mail_server_log.rb
index 3e7e0beb4..755584b90 100644
--- a/app/models/mail_server_log.rb
+++ b/app/models/mail_server_log.rb
@@ -122,14 +122,10 @@ class MailServerLog < ActiveRecord::Base
# 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.
- # We also allow an arbitrary subdomain on the incoming email domain. Why you may ask? Well, if for instance
- # you're using a "cloud" email provider to handle emails for your domain but you only want to pass the
- # Alaveteli emails to your own server you need to forward the Alaveteli emails to a different domain, in this
- # case a subdomain. Then, you make the MX records for the subdomain point at your server.
def MailServerLog.email_addresses_on_line(line)
prefix = Regexp::quote(Configuration::incoming_email_prefix)
domain = Regexp::quote(Configuration::incoming_email_domain)
- line.scan(/#{prefix}request-[^\s]+@\w*\.?#{domain}/).sort.uniq
+ line.scan(/#{prefix}request-[^\s]+@#{domain}/).sort.uniq
end
def MailServerLog.request_sent?(ir)
diff --git a/spec/models/mail_server_log_spec.rb b/spec/models/mail_server_log_spec.rb
index bcd74c380..d0a1d202f 100644
--- a/spec/models/mail_server_log_spec.rb
+++ b/spec/models/mail_server_log_spec.rb
@@ -89,11 +89,6 @@ describe MailServerLog do
it "ignores an email where the . is substituted for something else" do
MailServerLog.email_addresses_on_line("foi+request-14-e0e09f97@exampledcom").should be_empty
end
-
- it "accept emails with an arbitrary subdomain" do
- MailServerLog.email_addresses_on_line("foi+request-14-e0e09f97@foo.example.com").should ==
- ["foi+request-14-e0e09f97@foo.example.com"]
- end
end
context "Postfix" do