[FIX] base: remove BCC header from outgoing emails to avoid leaking information
When sending emails SMTP server only requires an author, recipients and the email to send. It does not make any modification of what is sent. It is therefore possible that BCC content is sent. BCC mean 'Blind Carbon Copy', the address in this field should be not send in the header of the mail and must be removed, if not the address are visible for all recipients. Closes #21965 .
This commit is contained in:
committed by
Thibault Delavallée
parent
fb2df13ea8
commit
2445f9e3c2
@@ -192,7 +192,7 @@ class IrMailServer(models.Model):
|
||||
"""Returns a new SMTP connection to the give SMTP server, authenticated
|
||||
with ``user`` and ``password`` if provided, and encrypted as requested
|
||||
by the ``encryption`` parameter.
|
||||
|
||||
|
||||
:param host: host or IP of SMTP server to connect to
|
||||
:param int port: SMTP port to connect to
|
||||
:param user: optional username to authenticate with
|
||||
@@ -397,6 +397,7 @@ class IrMailServer(models.Model):
|
||||
email_to = message['To']
|
||||
email_cc = message['Cc']
|
||||
email_bcc = message['Bcc']
|
||||
del message['Bcc']
|
||||
|
||||
smtp_to_list = filter(None, tools.flatten(map(extract_rfc2822_addresses, [email_to, email_cc, email_bcc])))
|
||||
assert smtp_to_list, self.NO_VALID_RECIPIENT
|
||||
|
||||
Reference in New Issue
Block a user