[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
Loading
Please register or sign in to comment