Skip to content

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

@pmweeks98

Description

@pmweeks98

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: "",
    },
  ],
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions