accept email sent to an alias from its mailbox

This commit is contained in:
Son NK 2021-06-04 17:45:51 +02:00
parent 79d0ef8906
commit 00e0b69c76
1 changed files with 7 additions and 7 deletions

View File

@ -492,13 +492,13 @@ def handle_forward(envelope, msg: Message, rcpt_to: str) -> List[Tuple[bool, str
LOG.w("User %s disabled, disable forwarding emails for %s", user, alias)
return [(False, "550 SL E20 Account disabled")]
mail_from = envelope.mail_from
for mb in alias.mailboxes:
# email send from a mailbox to 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, "250 Message accepted for delivery")]
# mail_from = envelope.mail_from
# for mb in alias.mailboxes:
# # email send from a mailbox to 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, "250 Message accepted for delivery")]
LOG.d("Create or get contact for from:%s reply-to:%s", msg["From"], msg["Reply-To"])
# prefer using Reply-To when creating contact