mirror of
https://github.com/simple-login/app.git
synced 2024-09-20 06:55:59 +08:00
always ignore loop email
This commit is contained in:
parent
fb87225d2d
commit
2a1d735800
|
@ -556,14 +556,14 @@ def handle_forward(envelope, msg: Message, rcpt_to: str) -> List[Tuple[bool, str
|
|||
else:
|
||||
return [(False, status.E504)]
|
||||
|
||||
if user.ignore_loop_email:
|
||||
mail_from = envelope.mail_from
|
||||
for mb in alias.mailboxes:
|
||||
# email sent from a mailbox to its alias
|
||||
if mb.email == mail_from:
|
||||
LOG.w("cycle email sent from %s to %s", mb, alias)
|
||||
handle_email_sent_to_ourself(alias, mb, msg, user)
|
||||
return [(True, status.E209)]
|
||||
# check if email is sent from alias's owning mailbox(es)
|
||||
mail_from = envelope.mail_from
|
||||
for mb in alias.mailboxes:
|
||||
# email sent from a mailbox to its alias
|
||||
if mb.email == mail_from:
|
||||
LOG.i("cycle email sent from %s to %s", mb, alias)
|
||||
handle_email_sent_to_ourself(alias, mb, msg, user)
|
||||
return [(True, status.E209)]
|
||||
|
||||
from_header = get_header_unicode(msg[headers.FROM])
|
||||
LOG.d("Create or get contact for from_header:%s", from_header)
|
||||
|
|
Loading…
Reference in a new issue