aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorMatthew Landauer <matthew@openaustralia.org>2012-10-10 15:07:24 +1100
committerMatthew Landauer <matthew@openaustralia.org>2012-10-10 15:07:24 +1100
commit36b9552ae4b44aba43a7de824c77a990cc827752 (patch)
tree158586951766bdd4db39a09bcfae935450f71770 /app/models
parent4869338b35a6e1fed6498f3d8ed24ee2139e65d6 (diff)
Don't get confused if there is no postfix queue id
Diffstat (limited to 'app/models')
-rw-r--r--app/models/exim_log.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/exim_log.rb b/app/models/exim_log.rb
index eb3099b5c..8a02d8b06 100644
--- a/app/models/exim_log.rb
+++ b/app/models/exim_log.rb
@@ -112,9 +112,11 @@ class EximLog < ActiveRecord::Base
result
end
+ # Retuns nil if there is no queue id
def EximLog.extract_postfix_queue_id_from_syslog_line(line)
# Assume the log file was written using syslog and parse accordingly
- SyslogProtocol.parse("<13>" + line).content.match(/^\S+: (\S+):/)[1]
+ m = SyslogProtocol.parse("<13>" + line).content.match(/^\S+: (\S+):/)
+ m[1] if m
end
def EximLog.email_addresses_on_line(line)