Permalink
Browse files

A small change to reduce likelyhood of nil match.

  • Loading branch information...
1 parent 5b84a9e commit a72cc673d422dc3c8da6f34691039b1e61afdecb @aiwilliams committed Jan 7, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/mlist/email.rb
View
@@ -27,15 +27,15 @@ def been_there_addresses
# Answers the usable destination addresses of the email.
#
def list_addresses
- bounce? ? tmail.header_string('to').match(/\Amlist-(.*)\Z/)[1] : recipient_addresses
+ bounce? ? tmail.header_string('to').sub(/\Amlist-/, '') : recipient_addresses
end
# Answers true if this email is a bounce.
#
# TODO Delegate to the email_server's bounce detector.
#
def bounce?
- tmail.header_string('to') =~ /mlist-/
+ tmail.header_string('to') =~ /\Amlist-/
end
def tmail=(tmail)
@@ -68,4 +68,4 @@ def respond_to?(method)
super || (method.to_s !~ /=\Z/ && tmail.respond_to?(method))
end
end
-end
+end

0 comments on commit a72cc67

Please sign in to comment.