Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

A small change to reduce likelyhood of nil match.

  • Loading branch information...
commit a72cc673d422dc3c8da6f34691039b1e61afdecb 1 parent 5b84a9e
@aiwilliams authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/mlist/email.rb
View
6 lib/mlist/email.rb
@@ -27,7 +27,7 @@ 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.
@@ -35,7 +35,7 @@ def list_addresses
# 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
Please sign in to comment.
Something went wrong with that request. Please try again.