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:
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,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