Use custom event

This commit is contained in:
Adrià Casajús 2022-03-21 12:14:51 +01:00
parent 06a1363e92
commit 9930433d21
No known key found for this signature in database
GPG Key ID: F0033226A5AFC9B9
1 changed files with 3 additions and 1 deletions

View File

@ -541,7 +541,9 @@ def handle_email_sent_to_ourself(alias, from_addr: str, msg: Message, user):
def apply_dmarc_policy(alias: Alias, contact: Contact, msg: Message) -> Optional[str]:
dmarc_result = get_dmarc_status(msg)
newrelic.agent.record_custom_metric("Custom/dmarc_check", dmarc_result)
newrelic.agent.record_custom_event(
"Custom/dmarc_check", {"result": dmarc_result.name}
)
if not ENABLE_DMARC_CHECK:
return None
if dmarc_result in (