mirror of
https://github.com/simple-login/app.git
synced 2025-11-10 01:40:49 +08:00
take into account BOUNCE_PREFIX_FOR_REPLY_PHASE when handling bounces
This commit is contained in:
parent
73555ad524
commit
60a1f48e6e
1 changed files with 11 additions and 0 deletions
|
|
@ -1575,11 +1575,22 @@ def handle(envelope: Envelope) -> str:
|
||||||
handle_transactional_bounce(envelope, rcpt_tos[0])
|
handle_transactional_bounce(envelope, rcpt_tos[0])
|
||||||
return "250 bounce handled"
|
return "250 bounce handled"
|
||||||
|
|
||||||
|
# whether this is a bounce report
|
||||||
|
is_bounce = False
|
||||||
|
|
||||||
if (
|
if (
|
||||||
len(rcpt_tos) == 1
|
len(rcpt_tos) == 1
|
||||||
and rcpt_tos[0].startswith(BOUNCE_PREFIX)
|
and rcpt_tos[0].startswith(BOUNCE_PREFIX)
|
||||||
and rcpt_tos[0].endswith(BOUNCE_SUFFIX)
|
and rcpt_tos[0].endswith(BOUNCE_SUFFIX)
|
||||||
):
|
):
|
||||||
|
is_bounce = True
|
||||||
|
|
||||||
|
if len(rcpt_tos) == 1 and rcpt_tos[0].startswith(
|
||||||
|
f"{BOUNCE_PREFIX_FOR_REPLY_PHASE}+"
|
||||||
|
):
|
||||||
|
is_bounce = True
|
||||||
|
|
||||||
|
if is_bounce:
|
||||||
return handle_bounce(envelope, rcpt_tos[0], msg)
|
return handle_bounce(envelope, rcpt_tos[0], msg)
|
||||||
|
|
||||||
# Whether it's necessary to apply greylisting
|
# Whether it's necessary to apply greylisting
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue