mirror of
https://github.com/simple-login/app.git
synced 2024-11-14 08:01:13 +01:00
fix dmarc_result can be None
This commit is contained in:
parent
cb92f1efea
commit
37de10e54c
1 changed files with 6 additions and 4 deletions
|
@ -543,11 +543,12 @@ def apply_dmarc_policy(
|
|||
alias: Alias, contact: Contact, envelope: Envelope, msg: Message
|
||||
) -> Optional[str]:
|
||||
dmarc_result = get_dmarc_status(msg)
|
||||
newrelic.agent.record_custom_event(
|
||||
"Custom/dmarc_check", {"result": dmarc_result.name}
|
||||
)
|
||||
if dmarc_result:
|
||||
newrelic.agent.record_custom_event(
|
||||
"Custom/dmarc_check", {"result": dmarc_result.name}
|
||||
)
|
||||
|
||||
if not DMARC_CHECK_ENABLED:
|
||||
if not DMARC_CHECK_ENABLED or not dmarc_result:
|
||||
return None
|
||||
|
||||
if dmarc_result in (
|
||||
|
@ -566,6 +567,7 @@ def apply_dmarc_policy(
|
|||
commit=True,
|
||||
)
|
||||
return status.E215
|
||||
|
||||
return None
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue