[FW][FIX] base: missing MIME-Version header #109184
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a second attempt at #64651
The reverted commit fixes the lack of a
MIME-Version
header on themail enveloppe by using
set_charset
. More specifically,set_charset
sets three headers:
MIME-Version
Content-Type
Transert-Encoding
of them only
MIME-Version
was required.The function was called prior of setting the mail's content or
alternatives.
Upon adding an alternative, python converts the current mail to a
multipart equivalent. Because of the two extra CT and TE headers, it
considered there was some content that needed to be moved inside of a
part, i.e. it created an empty part with the two CT and TE headers
set.
This empty part made our emails incompatible with Google G-Suite in case
an rich html footer was included via the G-Suite interface. Google would
wrongly reorder the email and move any text/plain part to the end of the
email and would show that part to the user instead of any text/html
part.
Google shouldn't change the order of our alternatives but he does and
it is easier for me to change our code than to fix google's.
Forward-Port-Of: #109056
Forward-Port-Of: #108499