Skip to content

[18.0][FIX] mail_composer_cc_bcc: prevent Bcc leak and Cc-only emails - #233

Open
divad1196 wants to merge 1 commit into
OCA:18.0from
camptocamp:fix_email_composer_cc_bcc_lang
Open

[18.0][FIX] mail_composer_cc_bcc: prevent Bcc leak and Cc-only emails#233
divad1196 wants to merge 1 commit into
OCA:18.0from
camptocamp:fix_email_composer_cc_bcc_lang

Conversation

@divad1196

@divad1196 divad1196 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Bcc Leak

Due to X-Odoo-Bcc email header, the Bcc were leaking.
Report in issue: #142

X-Odoo-Bcc can still be enabled, but is disabled by default.

Cc-only emails / Empty To header

Emails with no To were sent due to missing lang information.
Odoo groups emails using lang -> we need to add it as well.

Since the module ensure that we send 1 email per recipients (To+Cc+Bcc),
We can always drop the Cc-only email.

smtp_to guard

TLDR: if we had duplicate emails in the recipients, it would have caused:

  • Bcc to leak
  • All recipients would receive a duplicate email

It's fixed by using a list instead of a set. Guards are added.

Explanation:
recipients was a set() https://github.com/OCA/mail/pull/233/changes#diff-f9cbf73ff985af002f4ecff926acc085c850771dd464b63fa31d8ecbb9fd4470L53
-> It removed the duplicates

Then we checked and popped from self.env.context.get("recipients")
=> If we had duplicate emails, recipients would run off
=> we don't edit the smtp_to
=> Odoo will send a mail for all recipients (To+Cc+Bcc)

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @trisdoan,
some modules you are maintaining are being modified, check this out!

@OCA-git-bot OCA-git-bot added series:18.0 mod:mail_composer_cc_bcc Module mail_composer_cc_bcc labels Jul 13, 2026
@divad1196
divad1196 force-pushed the fix_email_composer_cc_bcc_lang branch 4 times, most recently from 2ffc45f to be00079 Compare July 15, 2026 21:05
Comment thread mail_composer_cc_bcc/models/mail_mail.py Outdated
Comment thread mail_composer_cc_bcc/models/mail_thread.py Outdated
@simahawk

Copy link
Copy Markdown
Contributor

@trisdoan ping

Due to X-Odoo-Bcc email header, the Bcc were leaking.
Report in issue: OCA#142
X-Odoo-Bcc can still be enabled, but is disabled by default.

Emails with no `To` were sent due to missing `lang` information.
Odoo groups emails using `lang` -> we need to add it as well
@divad1196

Copy link
Copy Markdown
Contributor Author

@trisdoan did you get the opportunity to have a look at these changes ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants