odoo/odoo#194988
Created by Bugfix, Séna Serge Nshimiyimana (sesn)
Statuses:
- legal/cla: Contributor License Agreement check
- ci/runbot: Odoo Test Suite
- ci/upgrade_enterprise: Test upgrades for enterprise master
- ci/template: Contact runbot team on discord for help.
- ci/style: Optional style check. Ignore it only if strictly necessary.
- ci/security: Required security check. Can only be ignored by security team.
- label
- odoo-dev:16.0-opw-4126522-eml_attachament_encoding-sesn
- head
- b77840d524bd071b4c850cd5542fdeb35157c045
- merged
- 7 months ago by SM Learn, Julien Castiaux (juc)
odoo/odoo | |
---|---|
16.0 | #194988 |
17.0 | #198862 |
saas-17.4 | #199099 |
18.0 | #199116 |
saas-18.1 | #199126 |
saas-18.2 | #199137 |
saas-18.3 | |
saas-18.4 | |
19.0 | |
master | #199141 |
[FIX] base: binary encode "message/rfc822" mail attachments
Currently, if an email containing a .eml
attachment is sent, that attachment won't be able to be downloaded correctly depending on the email client used; the attachment will download, but will have a size zero.
Steps to reproduce
- On any chatter, send a message containing a
.eml
attachment (another email file). - Using Thunderbird, attempt to download that attachment.
The downloaded attachment will be empty (0 kB).
Cause
The .eml
file format, which represents an email message, has the MIME type message/rfc822
. According to RFC 2046 Section 5.2.1, attachments of this MIME type must be encoded using 7bit
, 8bit
, or binary
. However, the system currently encodes all attachments using Base64 by default, which is not compliant with the standard for message/rfc822
.
Although some email clients tolerate Base64 encoding for message/rfc822
, others, such as Thunderbird, Roundcube, and Zimbra, strictly follow the RFC and reject Base64-encoded message/rfc822
attachments. As a result, these attachments appear invalid and are downloaded as empty files.