[19.0][FIX] mail_composer_cc_bcc: one email per recipient, no Bcc disclosure #2
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.49) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.49 · 352 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.351
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #2"
general
weight: 0.35
NICO-SOLUTIONS
Follow-up to my review on OCA/mail#104, pushed as commits as @NICO-SOLUTIONS suggested.
This branch builds on @Borruso's camptocamp/mail#1 — his commit is included unchanged, because his two fixes (renaming the override to
_prepare_email_message__, which 19.0 renamed, and copying theheadersdict) are what make the Bcc emails reach the SMTP server at all. Merging this brings both; if you would rather keep them separate, tell me and I will rebase onto19.0-mail_composer_cc_bcconce #1 is in.My commit adds two things on top.
1. One email per recipient (currently the last one is silently lost)
When
mail.email_tois empty Odoo builds an extra Cc-only email (odoo/odoo@46bad8f0). Here it is a duplicate: every Cc partner is a recipient and already gets its own email. It was being dropped by comparing lengths:recipientsis aset, and a Cc partner is counted once for the Cc-only entry and once for its own, so the count is short by one andpop()removes the last entry — the last recipient's email — instead of the duplicate. With one To, two Cc and two Bcc partners on 19.0:| | before | after |
|---|---|---|
| emails handed to the SMTP server | 5 | 5 |
|
cc1@| 2 copies | 1 ||
bcc2@| nothing | 1 |Filtering the Cc-only entry explicitly (
res = [m for m in res if m["email_to"]]) fixes both, and the length heuristic goes away.2. Drop
X-Msg-To-AddNew in 19.0:
MailThread._notify_by_email_get_headers()fills that header with every external recipient, andIrMailServer._alter_message__()merges it into theToheader at send time to enable Reply-All. Since this module builds the whole To/Cc itself, the header has to go — otherwise the Cc and Bcc addresses end up in theToof every email. I verified this A/B: with the header kept, every recipient (including the plain To one) receivesTo: to@…, cc1@…, bcc1@…, bcc2@….Tests
Two tests, both failing before this commit and passing after:
test_email_cc_bcc_one_email_per_recipient— 5 recipients → 5 emails, same To/Cc on all of them, no Bcc address visible in any To/Cc, and each Bcc recipient gets its own email.test_email_cc_bcc_no_reply_all_header— noX-Msg-To-Addsurvives.The existing
test_email_cc_bccassertedlen(self._mails) == 5and passed either way, because the count was right while the recipients were not.How this was checked
Official
odoo:19image (build19.0.20260723), fresh database, only this module installed, and the SMTP session replaced by a stub recording exactly what Odoo hands to the server (send_message(message, smtp_from, smtp_to_list)) — so the envelopes and headers above are the real ones, not a reading of the code. Full module test suite green (9 tests).