aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2011-09-09 12:16:27 +0100
committerSeb Bacon <seb.bacon@gmail.com>2011-09-09 14:21:47 +0100
commit7690df08b8e929cd8d9aa26cd7b1a79a39db760e (patch)
treef20d940c06c6fa1bc9b8867fd550d6c4c1ddb014 /app/models
parent289ecc765fc9feb60fd5ef68a168be026e0e4c33 (diff)
Improve detection of autoresponse emails, so we can discourage users from replying to them. Fixes #137 (partially)
Diffstat (limited to 'app/models')
-rw-r--r--app/models/incoming_message.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 16ae38b92..edc395ff4 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -1308,7 +1308,12 @@ class IncomingMessage < ActiveRecord::Base
if !prefix.nil? && prefix.downcase.match(/^(postmaster|mailer-daemon|auto_reply|donotreply|no.reply)$/)
return false
end
-
+ if !self.mail['return-path'].nil? && self.mail['return-path'].addr == "<>"
+ return false
+ end
+ if !self.mail['auto-submitted'].nil? && !self.mail['auto-submitted'].keys.empty?
+ return false
+ end
return true
end