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:
parent
fa50c23a43
commit
d415974e3b
|
@ -1171,7 +1171,13 @@ def handle_reply(envelope, msg: Message, rcpt_to: str) -> (bool, str):
|
||||||
add_or_replace_header(msg, headers.FROM, from_header)
|
add_or_replace_header(msg, headers.FROM, from_header)
|
||||||
|
|
||||||
try:
|
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)
|
replace_header_when_reply(msg, alias, headers.CC)
|
||||||
except NonReverseAliasInReplyPhase as e:
|
except NonReverseAliasInReplyPhase as e:
|
||||||
LOG.w("non reverse-alias in reply %s %s %s", e, contact, alias)
|
LOG.w("non reverse-alias in reply %s %s %s", e, contact, alias)
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
{% extends "base.txt.jinja2" %}
|
{% extends "base.txt.jinja2" %}
|
||||||
|
|
||||||
{% block content %}
|
{% 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 }}.
|
You can view the email at {{ refused_email_url }}.
|
||||||
This email is automatically deleted in 7 days.
|
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 %}
|
{% endblock %}
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
{% extends "base.txt.jinja2" %}
|
{% extends "base.txt.jinja2" %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
Hi
|
Hi
|
||||||
|
|
||||||
Your email sent to {{ destination }} from {{ alias }} ({{ subject }}) contains an address
|
Your email sent to {{ destination }} from {{ alias }} ({{ subject }}) contains an address
|
||||||
which isn't a reverse-alias in the To: or Cc: field.
|
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.
|
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.
|
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.
|
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
|
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
|
corresponding contacts to avoid any potential side effect. Please remove the non reverse-alias addresses and
|
||||||
re-send the email.
|
re-send the email.
|
||||||
|
|
||||||
More info about reverse-alias can be found on https://simplelogin.io/docs/getting-started/reverse-alias/
|
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/
|
and how to send an email from your alias on https://simplelogin.io/docs/getting-started/send-email/
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
Hi!
|
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!
|
Best!
|
||||||
SimpleLogin team
|
SimpleLogin team
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
{% extends "base.txt.jinja2" %}
|
{% extends "base.txt.jinja2" %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
Unauthorized attempt to send an email to {{ contact.email }} from your alias {{ alias.email }} using
|
Unauthorized attempt to send an email to {{ contact.email }} from your alias {{ alias.email }} using
|
||||||
{{ sender }} has been blocked.
|
{{ sender }} has been blocked.
|
||||||
|
|
||||||
To protect against email spoofing, only your mailbox can send emails on behalf of your alias.
|
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.
|
SimpleLogin also refuses emails that claim to come from your mailbox but fail DMARC.
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue