Skip to content
Snippets Groups Projects
Commit 36a2e5f4 authored by Julien Castiaux's avatar Julien Castiaux
Browse files

[FIX] mail: correctly format email address


Install Helpdesk, setup an email alias. Send to that alias an email
where the name of the from field contains unicode characters. The name
shown in the interface is base64 encoded, RFC compliant email name.

Python 2 `email.utils.formataddr` does not generate RFC compliant
header fields. It just formats the header as `name <email>`, quoting
the name when necessary. Only ASCII names/emails are supported but it is
convenient to show correctly formatted emails on forms.

Python 3 `email.utils.formataddr` generates RFC compliant header
fields, it encodes the name in base64 or quoted-printable when it
contains non-ascii characters. The entire unicode charset is supported
but the function shouldn't be used when showing email addresses on
forms.

The problem has been fixed by backporting our own `formataddr` (c024d89,
a66e16e and 81003c1). Our function supports both use cases : pretty
format and RFC compliant format.

opw-2115767

closes odoo/odoo#40298

Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
parent 4eb47d33
Branches
Tags
No related merge requests found
Showing
with 60 additions and 56 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment