mirror of
https://github.com/simple-login/app.git
synced 2024-09-27 20:31:30 +02:00
Report error when SPF fails on emails sent from mailbox. Return 451 instead of 550 to avoid bounce emails.
This commit is contained in:
parent
a3a8a13840
commit
5ec0ea5f6c
@ -477,10 +477,13 @@ def handle_reply(envelope, smtp: SMTP, msg: Message, rcpt_to: str) -> (bool, str
|
||||
# TODO: Handle temperr case (e.g. dns timeout)
|
||||
# only an absolute pass, or no SPF policy at all is 'valid'
|
||||
if r[0] not in ["pass", "none"]:
|
||||
LOG.d(
|
||||
"SPF validation failed for %s (reason %s)", mailbox_email, r[0],
|
||||
LOG.error(
|
||||
"SPF fail for mailbox %s, reason %s, failed IP %s",
|
||||
mailbox_email,
|
||||
r[0],
|
||||
msg["X-SimpleLogin-Client-IP"],
|
||||
)
|
||||
return False, "550 SL E11"
|
||||
return False, "451 SL E11"
|
||||
else:
|
||||
LOG.d(
|
||||
"Could not find X-SimpleLogin-Client-IP header %s -> %s",
|
||||
|
Loading…
Reference in New Issue
Block a user