aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2011-08-04 17:18:53 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2011-08-04 17:18:53 +0100
commitd2ca9f1f93e86bbcc389604b4f85cc0ecf2ef906 (patch)
treec749de37eb1e6717554e8f6827722e996df48256 /lib
parent6fbd9fcae218b675b298d7b4101e2f184e56818c (diff)
More pop3 tweaks
Diffstat (limited to 'lib')
-rw-r--r--lib/mauve/notifiers/email.rb4
-rw-r--r--lib/mauve/pop3_server.rb6
-rw-r--r--lib/mauve/version.rb2
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/mauve/notifiers/email.rb b/lib/mauve/notifiers/email.rb
index 8f2d32b..9676bf6 100644
--- a/lib/mauve/notifiers/email.rb
+++ b/lib/mauve/notifiers/email.rb
@@ -72,14 +72,14 @@ module Mauve
m.header.to = destination
m.header.from = @from
- m.header.date = case alert.update_type
+ m.header.date = ( case alert.update_type
when "cleared"
alert.cleared_at
when "acknowledged"
alert.acknowledged_at
else
alert.raised_at
- end
+ end ).to_time
m.header['Content-Type'] = "multipart/alternative"
diff --git a/lib/mauve/pop3_server.rb b/lib/mauve/pop3_server.rb
index b8253b0..25ee83c 100644
--- a/lib/mauve/pop3_server.rb
+++ b/lib/mauve/pop3_server.rb
@@ -219,13 +219,13 @@ module Mauve
if a =~ /\ALIST +(\d+)\b/
ind = $1.to_i
if ind > 0 and ind <= self.messages.length
- d << "+OK #{ind} #{self.messages[ind-1].length}"
+ d << "+OK #{ind} #{self.messages[ind-1][1].length}"
else
d << "-ERR Unknown message."
end
else
d << "+OK #{self.messages.length} messages (#{self.messages.inject(0){|s,m| s+= m[1].length}} octets)."
- self.messages.each_with_index{|m,i| d << "#{i+1} #{m.length}"}
+ self.messages.each_with_index{|m,i| d << "#{i+1} #{m[1].length}"}
d << "."
end
@@ -314,7 +314,7 @@ module Mauve
alerts_seen << [a.alert_id, a.update_type]
- @messages << [a, email.prepare_message(self.user, a.alert, [])]
+ @messages << [a, email.prepare_message(self.user+"@"+Server.instance.hostname, a.alert, [])]
end
end
diff --git a/lib/mauve/version.rb b/lib/mauve/version.rb
index 4b6e941..104f59a 100644
--- a/lib/mauve/version.rb
+++ b/lib/mauve/version.rb
@@ -1,5 +1,5 @@
module Mauve
- VERSION="3.3.1"
+ VERSION="3.3.2"
end