aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/incoming_message.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2012-12-04 10:50:25 +0000
committerLouise Crow <louise.crow@gmail.com>2012-12-04 10:53:09 +0000
commit41e3c41d08e97e232bb7cf2e1faec00c9aa0f92b (patch)
tree90dd42a1ea20d714333e7ab269c8a7384e949d6c /app/models/incoming_message.rb
parent6052df14bab5fe82cd5ccf1979dbfc6d6ab3befa (diff)
Rewrite spec to reflect delegation of low-level mail methods to mail handler, use mail handler methods.
Diffstat (limited to 'app/models/incoming_message.rb')
-rw-r--r--app/models/incoming_message.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 0ebf0017d..464910d01 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -89,11 +89,8 @@ class IncomingMessage < ActiveRecord::Base
# Return false if for some reason this is a message that we shouldn't let them reply to
def _calculate_valid_to_reply_to
# check validity of email
- if empty_from_field?
- return false
- end
email = self.from_email
- if !MySociety::Validate.is_valid_email(email)
+ if email.nil? || !MySociety::Validate.is_valid_email(email)
return false
end
@@ -106,10 +103,10 @@ class IncomingMessage < ActiveRecord::Base
if !prefix.nil? && prefix.downcase.match(/^(postmaster|mailer-daemon|auto_reply|do.?not.?reply|no.reply)$/)
return false
end
- if !self.mail['return-path'].nil? && self.mail['return-path'].addr == "<>"
+ if MailHandler.empty_return_path?(self.mail)
return false
end
- if !self.mail['auto-submitted'].nil?
+ if !MailHandler.get_auto_submitted(self.mail).nil?
return false
end
return true