mirror of
https://github.com/simple-login/app.git
synced 2025-02-23 15:23:27 +08:00
forward reply email can only by used by user email
This commit is contained in:
parent
46b0872710
commit
c5bf95fffe
1 changed files with 9 additions and 0 deletions
|
@ -215,6 +215,15 @@ class MailHandler:
|
||||||
forward_email = ForwardEmail.get_by(reply_email=reply_email)
|
forward_email = ForwardEmail.get_by(reply_email=reply_email)
|
||||||
alias: str = forward_email.gen_email.email
|
alias: str = forward_email.gen_email.email
|
||||||
|
|
||||||
|
user_email = forward_email.gen_email.user.email
|
||||||
|
if envelope.mail_from != user_email:
|
||||||
|
LOG.error(
|
||||||
|
f"Reply email can only be used by user email. Actual mail_from: %s. User email %s",
|
||||||
|
envelope.mail_from,
|
||||||
|
user_email,
|
||||||
|
)
|
||||||
|
return "550 forbidden"
|
||||||
|
|
||||||
# todo: add DKIM-Signature for custom domain
|
# todo: add DKIM-Signature for custom domain
|
||||||
# remove DKIM-Signature for custom domain
|
# remove DKIM-Signature for custom domain
|
||||||
if not alias.endswith(EMAIL_DOMAIN) and msg["DKIM-Signature"]:
|
if not alias.endswith(EMAIL_DOMAIN) and msg["DKIM-Signature"]:
|
||||||
|
|
Loading…
Reference in a new issue