mirror of
https://github.com/simple-login/app.git
synced 2024-09-20 15:05:59 +08:00
take into account mailbox in reply phase: check the reply must come from mailbox
This commit is contained in:
parent
7407f678ce
commit
2efe8cd160
|
@ -313,13 +313,18 @@ class MailHandler:
|
|||
if not CustomDomain.get_by(domain=alias_domain):
|
||||
return "550 alias unknown by SimpleLogin"
|
||||
|
||||
user_email = forward_email.gen_email.user.email
|
||||
if envelope.mail_from.lower() != user_email.lower():
|
||||
gen_email = forward_email.gen_email
|
||||
if gen_email.mailbox_id:
|
||||
mailbox_email = gen_email.mailbox.email
|
||||
else:
|
||||
mailbox_email = gen_email.user.email
|
||||
|
||||
if envelope.mail_from.lower() != mailbox_email.lower():
|
||||
LOG.warning(
|
||||
f"Reply email can only be used by user email. Actual mail_from: %s. msg from header: %s, User email %s. reply_email %s",
|
||||
envelope.mail_from,
|
||||
msg["From"],
|
||||
user_email,
|
||||
mailbox_email,
|
||||
reply_email,
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue