mirror of
https://github.com/simple-login/app.git
synced 2025-02-24 15:53:22 +08:00
Improve emails that inform unauthorized user
This commit is contained in:
parent
b41a61165c
commit
7598a167d0
3 changed files with 20 additions and 3 deletions
|
@ -186,7 +186,7 @@ def send_email(to_email, subject, plaintext, html):
|
||||||
msg["To"] = to_email
|
msg["To"] = to_email
|
||||||
|
|
||||||
msg.set_content(plaintext)
|
msg.set_content(plaintext)
|
||||||
if html is not None:
|
if html:
|
||||||
msg.add_alternative(html, subtype="html")
|
msg.add_alternative(html, subtype="html")
|
||||||
|
|
||||||
msg_id_header = make_msgid()
|
msg_id_header = make_msgid()
|
||||||
|
|
|
@ -348,10 +348,15 @@ class MailHandler:
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Notify sender that they cannot send emails to this address
|
||||||
send_email(
|
send_email(
|
||||||
envelope.mail_from,
|
envelope.mail_from,
|
||||||
f"Your email ({envelope.mail_from}) is not allowed to send email to {reply_email}",
|
f"Your email ({envelope.mail_from}) is not allowed to send emails to {reply_email}",
|
||||||
"",
|
render(
|
||||||
|
"transactional/send-from-alias-from-unknown-sender.txt",
|
||||||
|
sender=envelope.mail_from,
|
||||||
|
reply_email=reply_email,
|
||||||
|
),
|
||||||
"",
|
"",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
Hi,
|
||||||
|
|
||||||
|
This is an automated email from SimpleLogin.
|
||||||
|
|
||||||
|
We have recorded an attempt to send an email from your email ({{sender}}) to {{reply_email}}.
|
||||||
|
|
||||||
|
{{reply_email}} is a special email address that only receive emails from its authorized user.
|
||||||
|
|
||||||
|
If you have any question, you can contact us by replying to this email or consult our website at https://simplelogin.io.
|
||||||
|
|
||||||
|
Regards,
|
||||||
|
SimpleLogin team.
|
Loading…
Reference in a new issue