mirror of
https://github.com/simple-login/app.git
synced 2025-02-23 23:34:05 +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])
|
||||
return "250 bounce handled"
|
||||
|
||||
# whether this is a bounce report
|
||||
is_bounce = False
|
||||
|
||||
if (
|
||||
len(rcpt_tos) == 1
|
||||
and rcpt_tos[0].startswith(BOUNCE_PREFIX)
|
||||
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)
|
||||
|
||||
# Whether it's necessary to apply greylisting
|
||||
|
|
Loading…
Reference in a new issue