Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong parsing of text/html with boundary #232

Open
kadukf-outreach opened this issue Jan 28, 2022 · 1 comment
Open

Wrong parsing of text/html with boundary #232

kadukf-outreach opened this issue Jan 28, 2022 · 1 comment

Comments

@kadukf-outreach
Copy link

What I did:
Parsing a message which has text/html part but it contains also "boundary" marker. I know, this is an strange case but we have the messages with it.

IMO,

enmime/part.go

Line 404 in 1f2f4b0

if p.Boundary == "" {
we could check if the content type with "detectTextHeader", wdyt?

Or reporting it with error and providing content to the part. IMO the part is wrongly classified.

What I expected:
To have HTML text loaded from that part.

What I got:
Empty string + I cant access the body of that part :(

Release or branch I am using:
master
(Please attach a sample message if you feel it will help reproduce the issue)

------=_NextPart_001_0564_01D7A4BE.5DCBAE50

Content-Type: text/html;

boundary="_005_CO1PR15MB50972F18B0F86496F538DA40A1D49CO1PR15MB5097namp_";

charset="us-ascii";

type="multipart/alternative"

Content-Transfer-Encoding: quoted-printable
@jhillyerd
Copy link
Owner

Apologies for slow response. I agree, using detectTextHeader to not treat it at multipart, and adding a new error to error.go would be a good approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants