question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

quoted-printable encoding gets broken

See original GitHub issue

I don’t fully know if this is a bug or not at the moment, but after trying every quoted-printable method I found online and being unable to get any of them to work fully, I realised that something was happening in MSGViewer.

I have an email where the HTML content is using the content transfer encoding of quoted-printable

--_000_VE1PR08MB5743BA96566BD5163C527BD9CA129VE1PR08MB5743eurp_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:x=3D"urn:schemas-microsoft-com:office:excel" xmlns:m=3D"http://schema=
s.microsoft.com/office/2004/12/omml" xmlns=3D"http://www.w3.org/TR/REC-html=
40">

Every 76th character has a = character to signify line continuation.

MSGViewer seems to be doing some reformatting of the HTMLBody which breaks the encoding and it is unable to be decoded. Interestingly all the = signs end up at the start of the lines instead of the end.

=    <tbody>
=        <tr>
=            <td valign="bottom" style="width: 70%; font-family: Arial; =font-size: 10pt; white-space: nowrap; text-align: left;">

Is MSGReader doing something to the email body to break the encoding?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
TriJoecommented, Apr 20, 2022

After spending days on this, it’s the EOL type of the EML file that was the problem. Windows (CR LF) worked fine, but files using Unix (LF) had the issue. (Used Notepad++ to convert between them to confirm).

Spent far too long to find this out!

0reactions
Sicos1977commented, Apr 15, 2022

No response … closed

Read more comments on GitHub >

github_iconTop Results From Across the Web

Content-Transfer-Encoding: quoted-printable is breaks the ...
I´m sending emails through a Rails web app using AmazonSes service. I´m sending different types of emails and everything is working fine, but...
Read more >
decoding quoted-printable strings fails if lines broken in the ...
I'm attempting to decode a header that has been flowed into multiple lines, like so: Subject: =?utf-8?
Read more >
Is quoted-printable enough to make a mail compliant with ...
Lines of quoted-printable encoded data must not be longer than 76 characters. To satisfy this requirement without altering the encoded text, ...
Read more >
Quoted-Printable Encoding - Documentation
Line breaks, however, are not encoded. Therefore, quoted-printable encoding is only useful for text. Since the encoding does not protect a message against ......
Read more >
Quoted-printable - Wikipedia
Lines of Quoted-Printable encoded data must not be longer than 76 characters. To satisfy this requirement without altering the encoded text, soft line...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found