[tor-bugs] #9385 [BridgeDB]: bridgedb's email responder should fuzzy match email addresses within time periods

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Mar 25 21:48:17 UTC 2015


#9385: bridgedb's email responder should fuzzy match email addresses within time
periods
--------------------------+--------------------------------------------
     Reporter:  isis      |      Owner:  isis
         Type:  defect    |     Status:  reopened
     Priority:  normal    |  Milestone:
    Component:  BridgeDB  |    Version:
   Resolution:            |   Keywords:  bridgedb-email, bridgedb-0.2.3
Actual Points:            |  Parent ID:
       Points:            |
--------------------------+--------------------------------------------
Changes (by isis):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 The implementation was broken.  In
 `bridgedb.email.autoresponder.SMTPAutoresponder.runChecks()`, it does:

 {{{
          # If fuzzy matching is enabled via the EMAIL_FUZZY_MATCH setting,
 then
          # calculate the Levenshtein String Distance (see
          # :func:`~bridgedb.util.levenshteinDistance`):
          if self.incoming.context.fuzzyMatch != 0:
              for blacklistedAddress in self.incoming.context.blacklist:
                  distance =
 levenshteinDistance(self.incoming.canonicalFromEmail,
                                                 blacklistedAddress)
                  if distance <= self.incoming.context.fuzzyMatch:
                      logging.info("Fuzzy-matched %s to blacklisted address
 %s!"
                                   % (self.incoming.canonicalFromEmail,
                                      blacklistedAddress))
                      return False
 }}}

 which is broken because `self.incoming.canonicalFromEmail` is the client's
 canonicalised email domain from the email headers, e.g. for an address
 `''feidanchaoren0006 at gmail.com'` it would be `'gmail.com'`, which
 obviously doesn't have a levenshtein distance anything close to the
 `EMAIL_BLACKLIST` address which it should have fuzzy-matched
 (`'feidanchaoren0001 at gmail.com'`).

 The fix is simple: change `self.incoming.caconicalFromEmail` to
 `str(client)` to use the full email address.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/9385#comment:14>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list