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("(")
|
sep = spam_entries[entry_pos].find("(")
|
||||||
if sep > -1:
|
if sep > -1:
|
||||||
spam_entries[entry_pos] = spam_entries[entry_pos][:sep]
|
spam_entries[entry_pos] = spam_entries[entry_pos][:sep]
|
||||||
|
|
||||||
for header_value, dmarc_result in DmarcCheckResult.get_string_dict().items():
|
for header_value, dmarc_result in DmarcCheckResult.get_string_dict().items():
|
||||||
if header_value in spam_entries:
|
if header_value in spam_entries:
|
||||||
return dmarc_result
|
return dmarc_result
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
|
@ -547,6 +547,10 @@ def apply_dmarc_policy(
|
||||||
newrelic.agent.record_custom_event(
|
newrelic.agent.record_custom_event(
|
||||||
"Custom/dmarc_check", {"result": dmarc_result.name}
|
"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:
|
if not DMARC_CHECK_ENABLED or not dmarc_result:
|
||||||
return None
|
return None
|
||||||
|
|
Loading…
Reference in a new issue