Handle undisclosed recipients header (#1314)

* remove TO header if it's set to "undisclosed-recipients:;"

more info on https://www.rfc-editor.org/rfc/rfc4356.txt

* remove unnecessary indentation character in plain text email
This commit is contained in:
Son Nguyen Kim 2022-09-27 09:43:58 +02:00 committed by GitHub
parent fa50c23a43
commit d415974e3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 21 deletions

View file

@ -1171,7 +1171,13 @@ def handle_reply(envelope, msg: Message, rcpt_to: str) -> (bool, str):
add_or_replace_header(msg, headers.FROM, from_header)
try:
replace_header_when_reply(msg, alias, headers.TO)
if str(msg[headers.TO]).lower() == "undisclosed-recipients:;":
# no need to replace TO header
LOG.d("email is sent in BCC mode")
del msg[headers.TO]
else:
replace_header_when_reply(msg, alias, headers.TO)
replace_header_when_reply(msg, alias, headers.CC)
except NonReverseAliasInReplyPhase as e:
LOG.w("non reverse-alias in reply %s %s %s", e, contact, alias)

View file

@ -1,11 +1,11 @@
{% extends "base.txt.jinja2" %}
{% block content %}
An email from {{ from_header }} to {{ alias.email }} is put into Quarantine as it fails anti-phishing check.
An email from {{ from_header }} to {{ alias.email }} is put into Quarantine as it fails anti-phishing check.
You can view the email at {{ refused_email_url }}.
This email is automatically deleted in 7 days.
You can view the email at {{ refused_email_url }}.
This email is automatically deleted in 7 days.
More info about the anti-phishing measure on https://simplelogin.io/docs/getting-started/anti-phishing/
More info about the anti-phishing measure on https://simplelogin.io/docs/getting-started/anti-phishing/
{% endblock %}

View file

@ -1,19 +1,19 @@
{% extends "base.txt.jinja2" %}
{% block content %}
Hi
Hi
Your email sent to {{ destination }} from {{ alias }} ({{ subject }}) contains an address
which isn't a reverse-alias in the To: or Cc: field.
Your email sent to {{ destination }} from {{ alias }} ({{ subject }}) contains an address
which isn't a reverse-alias in the To: or Cc: field.
The email was then directly sent to this recipient and doesn't pass by SimpleLogin.
Unfortunately, it reveals your real mailbox address to the recipient.
Please create a reverse alias for each recipient to make sure your mailbox stays hidden and re-send the email.
The email was then directly sent to this recipient and doesn't pass by SimpleLogin.
Unfortunately, it reveals your real mailbox address to the recipient.
Please create a reverse alias for each recipient to make sure your mailbox stays hidden and re-send the email.
In case some reverse aliases are also present in To: or Cc:, SimpleLogin won't deliver this email to the
corresponding contacts to avoid any potential side effect. Please remove the non reverse-alias addresses and
re-send the email.
In case some reverse aliases are also present in To: or Cc:, SimpleLogin won't deliver this email to the
corresponding contacts to avoid any potential side effect. Please remove the non reverse-alias addresses and
re-send the email.
More info about reverse-alias can be found on https://simplelogin.io/docs/getting-started/reverse-alias/
and how to send an email from your alias on https://simplelogin.io/docs/getting-started/send-email/
More info about reverse-alias can be found on https://simplelogin.io/docs/getting-started/reverse-alias/
and how to send an email from your alias on https://simplelogin.io/docs/getting-started/send-email/
{% endblock %}

View file

@ -1,6 +1,8 @@
Hi!
Thanks for getting in touch. This mailbox cannot receive any emails. If you need help, please go to https://app.simplelogin.io/dashboard/support to contact us.
Thanks for getting in touch. This mailbox cannot receive any emails.
If you need help, please go to https://app.simplelogin.io/dashboard/support to contact us.
Best!
SimpleLogin team

View file

@ -1,10 +1,10 @@
{% extends "base.txt.jinja2" %}
{% block content %}
Unauthorized attempt to send an email to {{ contact.email }} from your alias {{ alias.email }} using
{{ sender }} has been blocked.
Unauthorized attempt to send an email to {{ contact.email }} from your alias {{ alias.email }} using
{{ sender }} has been blocked.
To protect against email spoofing, only your mailbox can send emails on behalf of your alias.
SimpleLogin also refuses emails that claim to come from your mailbox but fail DMARC.
To protect against email spoofing, only your mailbox can send emails on behalf of your alias.
SimpleLogin also refuses emails that claim to come from your mailbox but fail DMARC.
{% endblock %}