ERPNext.com Frappe Cloud Support Partners Foundation Frappe School

Duplicate emails are sent multiple times using CC or BCC

We use the email function in ERPNext to send confirmation to users as reminder of order renewal but we’ve had several reclamation because emails are sent several times each.
I’ve tried to trace the misbehaviour and found that if we use CC or BCC it affects the number of mails.

If there’s only one recipient, then only one mail is sent.
If there’s two recipients, mails are sent twice (for each recipient).
If there’s three recipients, mails are sent three times (for each recipient)

I tried to analyze the code in https://github.com/frappe/frappe/blob/version-12/frappe/email/queue.py but as I have very little experience in Python, I’m having hard time to find the exact spot which might affect this.

Please, could someone with more experience test this out and point me to the right direction in order to fix this behavior.

ERPNext: v12.26.0 (version-12)

Frappe Framework: v12.23.0 (version-12)