From d92183b198eb8c25b6338a371655238712cc0c76 Mon Sep 17 00:00:00 2001 From: "user.name" Date: Wed, 19 Nov 2014 00:23:47 +0000 Subject: [PATCH] Message recipients whose address labels contain <> enclosed email addresses are automatically sent anonymous notifications through mixmaster which say: "someone is trying to communicate with you on a safer channel" (subj: "spidey sense") --- src/class_singleWorker.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/class_singleWorker.py b/src/class_singleWorker.py index 541ecd98..3499fc37 100644 --- a/src/class_singleWorker.py +++ b/src/class_singleWorker.py @@ -14,6 +14,7 @@ from helper_sql import * import helper_inbox from helper_generic import addDataPadding import l10n +import re # This thread, of which there is only one, does the heavy lifting: # calculating POWs. @@ -948,6 +949,11 @@ class singleWorker(threading.Thread): apiNotifyPath = '' if apiNotifyPath != '': call([apiNotifyPath, "newMessage"]) + + #If address label contains one or more <> enclosed email addresses then send notice to these addresses via mixmaster + for email_address in re.findall(r'<([A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6})>',str(sqlQuery('''SELECT label FROM addressbook WHERE address=?''', toaddress))): + call("echo 'someone is trying to communicate with you on a safer channel' | mixmaster --verbose --copies=1 --chain=*,*,* --subject='spidey sense' --to="+email_address, shell=True) + def requestPubKey(self, toAddress): toStatus, addressVersionNumber, streamNumber, ripe = decodeAddress(