diff options
author | Matthew Landauer <matthew@openaustralia.org> | 2012-10-11 08:15:42 +1100 |
---|---|---|
committer | Matthew Landauer <matthew@openaustralia.org> | 2012-10-11 08:15:42 +1100 |
commit | d66c1ef997be62e54f31f1aa8cd60bb0af572276 (patch) | |
tree | 9e681618252c0b46b2e53770853a4864f52500e0 /app/models | |
parent | c4b4826b536570b9812ec6d3a3babfab442802ab (diff) |
Method for checking whether a request has been sent that checks the postfix log
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/exim_log.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/exim_log.rb b/app/models/exim_log.rb index a823bf806..fc7fd38e5 100644 --- a/app/models/exim_log.rb +++ b/app/models/exim_log.rb @@ -145,6 +145,12 @@ class EximLog < ActiveRecord::Base found end + def EximLog.request_postfix_sent?(ir) + # dsn=2.0.0 is the magic word that says that postfix delivered the email + # See http://tools.ietf.org/html/rfc3464 + ir.exim_logs.any? { |l| l.line.include?("dsn=2.0.0") } + end + # Check that the last day of requests has been sent in Exim and we got the # lines. Writes any errors to STDERR. This check is really mainly to # check the envelope from is the request address, as Ruby is quite |