[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #9385 [BridgeDB]: bridgedb's email responder should fuzzy match email addresses within time periods
#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@xxxxxxxxx'` 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@xxxxxxxxx'`).
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
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs