Browse Source

complete rule engine

master
Volker Birk 2 years ago
parent
commit
223dc32632
1 changed files with 24 additions and 0 deletions
  1. +24
    -0
      enigmail.py

+ 24
- 0
enigmail.py View File

@ -121,6 +121,30 @@ class Rules:
break
elif len(rule.attrib['keyId']) > 2:
return rule.attrib['keyId'][2:]
elif rule.attrib['email'][0] == '{':
begins = rule.attrib['email'][1:]
if email[:len(begins)] == begins:
result = rule.attrib['encrypt'] != '0'
if rule.attrib['keyId'] == '.':
break
elif len(rule.attrib['keyId']) > 2:
return rule.attrib['keyId'][2:]
elif rule.attrib['email'][-1] == '}':
ends = rule.attrib['email'][:-1]
if email[len(email) - len(ends):] == ends:
result = rule.attrib['encrypt'] != '0'
if rule.attrib['keyId'] == '.':
break
elif len(rule.attrib['keyId']) > 2:
return rule.attrib['keyId'][2:]
else:
if rule.attrib['email'][:-1] in email:
result = rule.attrib['encrypt'] != '0'
if rule.attrib['keyId'] == '.':
break
elif len(rule.attrib['keyId']) > 2:
return rule.attrib['keyId'][2:]
return result


Loading…
Cancel
Save