mirror of
https://github.com/simple-login/app.git
synced 2024-09-20 15:05:59 +08:00
log event when there's no dmarc result
This commit is contained in:
parent
ce2d2a3b3a
commit
63b1100a8b
|
@ -1451,7 +1451,9 @@ def get_dmarc_status(msg: Message) -> Optional[DmarcCheckResult]:
|
|||
sep = spam_entries[entry_pos].find("(")
|
||||
if sep > -1:
|
||||
spam_entries[entry_pos] = spam_entries[entry_pos][:sep]
|
||||
|
||||
for header_value, dmarc_result in DmarcCheckResult.get_string_dict().items():
|
||||
if header_value in spam_entries:
|
||||
return dmarc_result
|
||||
|
||||
return None
|
||||
|
|
|
@ -547,6 +547,10 @@ def apply_dmarc_policy(
|
|||
newrelic.agent.record_custom_event(
|
||||
"Custom/dmarc_check", {"result": dmarc_result.name}
|
||||
)
|
||||
else:
|
||||
newrelic.agent.record_custom_event(
|
||||
"Custom/dmarc_check", {"result": "N/A"}
|
||||
)
|
||||
|
||||
if not DMARC_CHECK_ENABLED or not dmarc_result:
|
||||
return None
|
||||
|
|
Loading…
Reference in a new issue