improve email template

This commit is contained in:
Son NK 2020-09-29 13:03:15 +02:00
parent e8ccbced59
commit 65938d2fb7
3 changed files with 7 additions and 9 deletions

View File

@ -1010,6 +1010,7 @@ def handle_unknown_mailbox(
authorize_address_link = ( authorize_address_link = (
f"{URL}/dashboard/mailbox/{alias.mailbox_id}/#authorized-address" f"{URL}/dashboard/mailbox/{alias.mailbox_id}/#authorized-address"
) )
mailbox_emails = [mailbox.email for mailbox in alias.mailboxes]
send_email_with_rate_control( send_email_with_rate_control(
user, user,
ALERT_REVERSE_ALIAS_UNKNOWN_MAILBOX, ALERT_REVERSE_ALIAS_UNKNOWN_MAILBOX,
@ -1021,6 +1022,7 @@ def handle_unknown_mailbox(
alias=alias, alias=alias,
sender=envelope.mail_from, sender=envelope.mail_from,
authorize_address_link=authorize_address_link, authorize_address_link=authorize_address_link,
mailbox_emails=mailbox_emails
), ),
render( render(
"transactional/reply-must-use-personal-email.html", "transactional/reply-must-use-personal-email.html",
@ -1028,6 +1030,7 @@ def handle_unknown_mailbox(
alias=alias, alias=alias,
sender=envelope.mail_from, sender=envelope.mail_from,
authorize_address_link=authorize_address_link, authorize_address_link=authorize_address_link,
mailbox_emails=mailbox_emails
), ),
) )

View File

@ -8,10 +8,8 @@
{% endcall %} {% endcall %}
{% call text() %} {% call text() %}
Please note that sending from this alias only works from one of these mailboxes: <br> Please note that sending from this alias only works from alias's owning mailboxes, that are
{% for mailbox in alias.mailboxes %} {{ mailbox_emails|join(", ") }}
- {{ mailbox.email }} <br>
{% endfor %}
{% endcall %} {% endcall %}
{% call text() %} {% call text() %}

View File

@ -2,11 +2,8 @@ Hi {{name}}
We have recorded an attempt to send an email from your alias {{ alias.email }} using {{ sender }}. We have recorded an attempt to send an email from your alias {{ alias.email }} using {{ sender }}.
Please note that sending from this alias only works from one of these mailboxes: Please note that sending from this alias only works from alias's owning mailboxes, that are
{{ mailbox_emails|join(", ") }}
{% for mailbox in alias.mailboxes %}
- {{mailbox.email}}
{% endfor %}
This is to protect against "email spoofing", i.e. someone else sending emails from your mailbox. This is to protect against "email spoofing", i.e. someone else sending emails from your mailbox.
If {{ sender }} can indeed send emails from your alias, you can add it to the allow list on {{authorize_address_link}} If {{ sender }} can indeed send emails from your alias, you can add it to the allow list on {{authorize_address_link}}