SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit dba3ffff authored by George Katsikas's avatar George Katsikas :goat:
Browse files

extend possible scam keywords in mailgun filter

parent 0ac05a97
No related branches found
No related tags found
No related merge requests found
......@@ -36,7 +36,9 @@ def send_mailgun_alert_slack_message(event_data: dict):
error_description = event_data.get("delivery-status", {}).get("message", "unknown")
# Ignore spam email directed to SciPost
if "spam" in error_description and "scipost" in recipient:
bad_keywords = ["spam", "scam", "phishing", "fraud", "viral"]
error_contains_keyword = any(k in error_description.lower() for k in bad_keywords)
if "scipost" in recipient and error_contains_keyword:
return
message = f"[{event.upper()} / {reason}] {subject}\n{sender} -> {recipient}\nError: {error_description}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment