Speed up processing by loading folders and categories on 1st run

This commit will also
- Update package requirements
- Update filters
This commit is contained in:
Stacy Brock
2024-02-15 15:15:00 -08:00
parent 6e942d329f
commit defa1de136
3 changed files with 37 additions and 21 deletions

View File

@@ -62,6 +62,7 @@ BLOCK_DOMAINS = [
'denodo.com',
'exacttarget.com',
'freshsales.io',
'hrciconnect.com',
'ikigailabs.io',
'impetus.com',
'informareachmedia.com',
@@ -127,7 +128,7 @@ ALLOW = [
'heliocampus.atlassian.net',
'ctptravelservices.com',
'Travel@concursolutions.com',
'substack.com',
'ghost.io',
'nytdirect@nytimes.com'
]
@@ -293,13 +294,10 @@ def filter_message(self, message):
move_message(message, 'Junk Email')
return
# add 'OSU Inform' category to internal messages sent to DLs
if ('@oregonstate.edu' in normalized_from
and ((not get_header('To', headers)
and not get_header('List-Id', headers))
or ('inform-c' in ' '.join(normalized_to)))):
self._log_result(message, "adding category 'OSU Inform'")
add_category(message, 'OSU Inform')
# add 'HelioCampus' category to messages from HC
if '@heliocampus' in normalized_from:
self._log_result(message, "adding category 'HelioCampus'")
add_category(message, 'HelioCampus')
return
# keep messages from allowed emails and domains
@@ -343,6 +341,15 @@ def filter_message(self, message):
move_message(message, 'Junk Email')
return
# add 'OSU Inform' category to internal messages sent to DLs
if ('@oregonstate.edu' in normalized_from
and ((not get_header('To', headers)
and not get_header('List-Id', headers))
or ('inform-c' in ' '.join(normalized_to)))):
self._log_result(message, "adding category 'OSU Inform'")
add_category(message, 'OSU Inform')
return
# KEEP MESSAGE
self._log_result(message, 'keeping message, passed all filter checks')