When sending a "multipart/alternative" message where the HTML portion is base64 encoded, the Content-Transfer-Encoding is not set properly if there is no space in the "Content-Transfer-Encoding" header after the colon.

For example, sending a message with the following body will NOT mark the section with base64 encoding as being base64 encoded, so the raw base64 text will be displayed in the recipient's email client:

This is a multi-part message in MIME format.

--9a8f7e25b7f276955e4f41094c87281db5db920e1
Content-Type:multipart/alternative;
 boundary="0e8885444c69ad0beca8e4c92eb849283046ce530"
Content-Transfer-Encoding:8bit


--0e8885444c69ad0beca8e4c92eb849283046ce530
Content-Type:text/plain; charset=utf-8
Content-Disposition:inline
Content-Transfer-Encoding:8bit

[SOME TEXT]

--0e8885444c69ad0beca8e4c92eb849283046ce530
Content-Type:text/html; charset=utf-8
Content-Disposition:inline
Content-Transfer-Encoding:base64

[SOME BASE46 ENCODED CONTENT]

--0e8885444c69ad0beca8e4c92eb849283046ce530--

--9a8f7e25b7f276955e4f41094c87281db5db920e1--
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jlicht created an issue. See original summary.

jlicht’s picture

Status: Active » Needs review
FileSize
957 bytes
957 bytes

Here is the fix.

Status: Needs review » Needs work

The last submitted patch, 2: smtp-2909678-2-d8.patch, failed testing. View results

jlicht’s picture

Status: Needs work » Needs review
FileSize
893 bytes

Reuploading patch, with fixed paths

Status: Needs review » Needs work

The last submitted patch, 4: smtp-2909678-3-d8.patch, failed testing. View results

jlicht’s picture

Status: Needs work » Needs review
FileSize
873 bytes

One more time...

Chris Matthews’s picture

Assigned: jlicht » Unassigned
Status: Needs review » Needs work
Issue tags: +Needs reroll

The 2 year old patch in #6 no longer applies to 8.x-1.x-dev.

jlicht’s picture

Reroll against 8.x-1.x-dev

Chris Matthews’s picture

Issue tags: -Needs reroll

Removing 'Needs reroll' tag

espurnes’s picture

Reroll against 8.x-1.x-dev.

It just updates line numbers.

carsonw’s picture

Status: Needs work » Reviewed & tested by the community

We were experiencing unencoded base64 email content (smtp + mimemail + webform), and after a long journey of troubleshooting, I discovered this issue, and this patch saved the day.

  • japerry committed 18f2dcc on 8.x-1.x authored by espurnes
    Issue #2909678 by jlicht, espurnes: Content-Transfer-Encoding header...
japerry’s picture

Status: Reviewed & tested by the community » Fixed

Fixed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.