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

Gap between Content-type and rest of headers leads to body being decoded as an attachment #47

Closed
pmweeks98 opened this issue Mar 10, 2023 · 0 comments · Fixed by #49
Closed
Labels
bug Something isn't working

Comments

@pmweeks98
Copy link
Collaborator

Not sure why this happened but recieved an eml file with the content-type being separated from the rest of the headers. This has caused the body to be decoded as an attachment.

Eg. this email

MIME-Version: 1.0
Date: Thu, 29 Sep 2022 12:22:20 +0100
Message-ID:
  <CAGFso0R6WbMomMx6mFFJzt_wiL8wRm3sN0YQwXz12Ugbt72XSw@mail.gmail.com>
Subject: A subject with spaces
From: =?UTF-8?Q?Nobody_there?= <dummyEmail@emailClient.com>
To: =?UTF-8?Q?Nobody_here?= <dummyEmail2@emailClient.com>



Content-type: multipart/related; 
	Boundary="0__=4EBB03D9DFA98AD48f9e8a93df938690918c4EBB03D9DFA98AD4"

--0__=4EBB03D9DFA98AD48f9e8a93df938690918c4EBB03D9DFA98AD4
Content-type: multipart/alternative; 
	Boundary="1__=4EBB03D9DFA98AD48f9e8a93df938690918c4EBB03D9DFA98AD4"

--1__=4EBB03D9DFA98AD48f9e8a93df938690918c4EBB03D9DFA98AD4
Content-transfer-encoding: quoted-printable
Content-type: text/plain; charset=ISO-8859-1



This is a test
=

--1__=4EBB03D9DFA98AD48f9e8a93df938690918c4EBB03D9DFA98AD4
Content-transfer-encoding: quoted-printable
Content-type: text/html; charset=ISO-8859-1
Content-Disposition: inline

<html><body>
<p><font size=3D"2" face=3D"sans-serif">This is a test</font><br>
</body></html>=


--1__=4EBB03D9DFA98AD48f9e8a93df938690918c4EBB03D9DFA98AD4--


--0__=4EBB03D9DFA98AD48f9e8a93df938690918c4EBB03D9DFA98AD4
Content-type: image/gif; 
	name="ecblank.gif"
Content-Disposition: inline; filename="ecblank.gif"
Content-ID: <1__=4EBB03D9DFA98AD48f9e8a93df938690918c4EBB03D9DFA98AD4@gmail.com>
Content-Transfer-Encoding: base64

R0lGODlhEAABAIAAAAAAAP///yH5BAEAAAEALAAAAAAAAAAQAAEAAAIEjI8ZBQA7


--0__=4EBB03D9DFA98AD48f9e8a93df938690918c4EBB03D9DFA98AD4--


Results in no Content-type in headers from readEml and the remainder of eml file as the data in a single attachment

@pmweeks98 pmweeks98 added the bug Something isn't working label Mar 10, 2023
pmweeks98 added a commit to pmweeks98/eml-parse-js that referenced this issue Mar 10, 2023
pmweeks98 added a commit to pmweeks98/eml-parse-js that referenced this issue Mar 10, 2023
pmweeks98 added a commit to pmweeks98/eml-parse-js that referenced this issue Mar 12, 2023
MQpeng added a commit that referenced this issue Mar 13, 2023
fix: check for Content-type in body of email (#47)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant