[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit b5b3d3c8e7038b45e87b91e97cae1d2658b939c7
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
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,



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits