Skip to content
Snippets Groups Projects
Commit 441746d0 authored by Thibault Delavallée's avatar Thibault Delavallée
Browse files

[FIX] mail: avoid multi-emails in outgoing emails 'from'

PURPOSE

Be defensive when dealing with email fields, notably when having multi-emails
or email field containing an already-formatted email.

SPECIFICATIONS

When building the final 'from' of outgoing emails using 'formataddr' we
have issues if email contains multi emails or formatted email. Having a
wrongly formatted email in 'email_from' leads to issues as it is badly
recognized by email providers, could be considered as being phishing and
also breaks reply_to mechanism.

Main fix of this commit is to extract emails and rebuild the 'email_from'
based on found emails. 'from' of sent emails is now the first found email
in 'email_from' field of related <mail.mail> record like

  -> before: email_from: '"Raoul" <raoul@raoul.fr>, raoul2@raoul.fr'
  -> after: email_from: '"Raoul" <raoul@raoul.fr>' and raoul2 is ignored

Task-2612945 (Mail: Defensive email formatting)

Part-of: odoo/odoo#74474
parent 9ef715fb
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment