Update filters & package requirements
This commit is contained in:
@@ -28,6 +28,7 @@ BLOCK_KEYWORDS = [
|
||||
'prefer not to receive',
|
||||
'prefer not to see',
|
||||
'rather not receive',
|
||||
'remove from list',
|
||||
'remove from this list',
|
||||
'Samsung SDS America',
|
||||
'sidekickopen',
|
||||
@@ -61,18 +62,20 @@ BLOCK_DOMAINS = [
|
||||
'norstar.net',
|
||||
'pphosted.com',
|
||||
'radware.com',
|
||||
'rsmatco.com',
|
||||
'sendgrid.net',
|
||||
'sparkpostmail.com',
|
||||
'techmate.com',
|
||||
'thesourcery.com',
|
||||
'trustedmailservers.com',
|
||||
'zerowait.com',
|
||||
'znsrc.com'
|
||||
]
|
||||
|
||||
BLOCK_ANNOYING = [
|
||||
'charitable fund drive',
|
||||
'election reminder',
|
||||
'faculty senate',
|
||||
'faculty senate agenda',
|
||||
'food drive',
|
||||
'food share',
|
||||
'general election',
|
||||
@@ -105,7 +108,8 @@ ALLOW = [
|
||||
'docusign.net',
|
||||
'ideal-logic.com',
|
||||
'heliocampus.atlassian.net',
|
||||
'ctptravelservices.com'
|
||||
'ctptravelservices.com',
|
||||
'Travel@concursolutions.com'
|
||||
]
|
||||
|
||||
normalized = {}
|
||||
@@ -130,6 +134,7 @@ def filter_message(self, message):
|
||||
' - OK',
|
||||
'ODProd Row Count Comparison',
|
||||
'Oracle ODprod Sessions Older Than Today',
|
||||
'DSDB Server Audit',
|
||||
'UserBase.Users users deactivated due to ORG changes and termination',
|
||||
'SSRS Datasets Needing Caching',
|
||||
'Audit Update',
|
||||
@@ -287,12 +292,11 @@ def is_in_message(list_, message):
|
||||
is_found = False
|
||||
message_body = message.body.lower()
|
||||
message_subject = message.subject.lower()
|
||||
message_from = message.sender.address.lower()
|
||||
|
||||
for term in list_:
|
||||
if term in message_subject:
|
||||
is_found = True
|
||||
break
|
||||
if term in message_body:
|
||||
if (term in message_subject or term in message_from
|
||||
or term in message_body):
|
||||
is_found = True
|
||||
break
|
||||
return is_found
|
||||
|
||||
Reference in New Issue
Block a user