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

If body is marked with Content-Disposition: inline then the body is parsed as an attachment #52

Open
pmweeks98 opened this issue May 4, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@pmweeks98
Copy link
Collaborator

Body is parsed as an attachment - I think because of the Content-Disposition: inline line

Date: Sun, 23 Apr 2023 00:23:08 +0200
Message-ID:
  <CAGFso0R6WbMomMx6mFFJzt_wiL8wRm3sN0YQwXz12Ugbt72XSw@mail.gmail.com>
Subject: A subject with spaces
From: =?UTF-8?Q?Nobody_there?= <[email protected]>
To: =?UTF-8?Q?Nobody_here?= <[email protected]>
Content-Type: multipart/alternative; boundary="=_ohFeHkpibN03-stIVrreU01"



--=_ohFeHkpibN03-stIVrreU01
Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes
Content-Disposition: inline
Content-Description: Message en texte brut

Test

--=_ohFeHkpibN03-stIVrreU01
Content-Type: text/html; charset=utf-8
Content-Disposition: inline
Content-Description: Message HTML

<div>Test</div>
--=_ohFeHkpibN03-stIVrreU01--

Output

{
  date: "2023-04-22T22:23:08.000Z",
  subject: "A subject with spaces",
  from: {
    name: "Nobody there",
    email: "[email protected]",
  },
  to: {
    name: "Nobody here",
    email: "[email protected]",
  },
  headers: {
    Date: "Sun, 23 Apr 2023 00:23:08 +0200",
    "Message-ID": "\r\n<CAGFso0R6WbMomMx6mFFJzt_wiL8wRm3sN0YQwXz12Ugbt72XSw@mail.gmail.com>",
    Subject: "A subject with spaces",
    From: "=?UTF-8?Q?Nobody_there?= <[email protected]>",
    To: "=?UTF-8?Q?Nobody_here?= <[email protected]>",
    "Content-Type": "multipart/alternative; boundary=\"=_ohFeHkpibN03-stIVrreU01\"",
  },
  attachments: [
    {
      contentType: "text/plain; charset=utf-8; format=flowed; DelSp=Yes",
      inline: true,
      data: "Test\r\n",
      data64: "",
    },
    {
      contentType: "text/html; charset=utf-8",
      inline: true,
      data: "<div>Test</div>\r\n\r\n",
      data64: "",
    },
  ],
}
@pmweeks98 pmweeks98 added the bug Something isn't working label May 4, 2023
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

No branches or pull requests

1 participant