mirror of
https://github.com/simple-login/app.git
synced 2024-11-16 17:08:30 +01:00
log when an email fails dmarc
This commit is contained in:
parent
e11c257571
commit
cb92f1efea
1 changed files with 3 additions and 0 deletions
|
@ -546,13 +546,16 @@ 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}
|
||||||
)
|
)
|
||||||
|
|
||||||
if not DMARC_CHECK_ENABLED:
|
if not DMARC_CHECK_ENABLED:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if dmarc_result in (
|
if dmarc_result in (
|
||||||
DmarcCheckResult.quarantine,
|
DmarcCheckResult.quarantine,
|
||||||
DmarcCheckResult.reject,
|
DmarcCheckResult.reject,
|
||||||
DmarcCheckResult.soft_fail,
|
DmarcCheckResult.soft_fail,
|
||||||
):
|
):
|
||||||
|
LOG.w(f"put email from {contact} to {alias} to quarantine. {dmarc_result}")
|
||||||
quarantine_dmarc_failed_email(alias, contact, envelope, msg)
|
quarantine_dmarc_failed_email(alias, contact, envelope, msg)
|
||||||
Notification.create(
|
Notification.create(
|
||||||
user_id=alias.user_id,
|
user_id=alias.user_id,
|
||||||
|
|
Loading…
Reference in a new issue