[tor-commits] [bridgedb/master] Fix bug in Levenshtein fuzzy matching for EMAIL_BLACKLIST.

isis at torproject.org isis at torproject.org
Fri May 1 07:10:57 UTC 2015


commit b5b3d3c8e7038b45e87b91e97cae1d2658b939c7
Author: Isis Lovecruft <isis at torproject.org>
Date:   Wed Mar 25 21:49:41 2015 +0000

    Fix bug in Levenshtein fuzzy matching for EMAIL_BLACKLIST.
    
    See https://bugs.torproject.org/9385#comment:14.
---
 lib/bridgedb/email/autoresponder.py |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/bridgedb/email/autoresponder.py b/lib/bridgedb/email/autoresponder.py
index 80ad83d..aba92ac 100644
--- a/lib/bridgedb/email/autoresponder.py
+++ b/lib/bridgedb/email/autoresponder.py
@@ -672,8 +672,7 @@ class SMTPAutoresponder(smtp.SMTPClient):
         # :func:`~bridgedb.util.levenshteinDistance`):
         if self.incoming.context.fuzzyMatch != 0:
             for blacklistedAddress in self.incoming.context.blacklist:
-                distance = levenshteinDistance(self.incoming.canonicalFromEmail,
-                                               blacklistedAddress)
+                distance = levenshteinDistance(str(client), blacklistedAddress)
                 if distance <= self.incoming.context.fuzzyMatch:
                     logging.info("Fuzzy-matched %s to blacklisted address %s!"
                                  % (self.incoming.canonicalFromEmail,





More information about the tor-commits mailing list