parsemail icon indicating copy to clipboard operation
parsemail copied to clipboard

Reading attachements reads nothing

Open Jomy10 opened this issue 2 years ago • 1 comments

When I try to read an attachement, there are no bytes returned

var content []byte
size, err := attachement.Data.Read(content)
// size = 0

The email roughly looks like this:

Content-Type: multipart/mixed; boundary="000000000000f229a405f393ef1b"
<!-- ... -->

--000000000000f229a405f393ef1b
Content-Type: multipart/alternative; boundary="000000000000f229a105f393ef19"

--000000000000f229a105f393ef19
Content-Type: text/plain; charset="UTF-8"

<!-- ... -->

--000000000000f229a105f393ef19
Content-Type: text/html; charset="UTF-8"

<!-- ... -->

--000000000000f229a105f393ef19--
--000000000000f229a405f393ef1b
Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document;
        name="bondsstaf 27_01_2023 JULIE.docx"
Content-Disposition: attachment; filename="bondsstaf 27_01_2023 JULIE.docx"
Content-Transfer-Encoding: base64
Content-ID: <f_ldkltcqk0>
X-Attachment-Id: f_ldkltcqk0

<!-- attachement in base64 ... -->
--000000000000f229a405f393ef1b--

Jomy10 avatar Feb 02 '23 07:02 Jomy10

Try https://github.com/OfimaticSRL/parsemail

xhit avatar Mar 20 '23 17:03 xhit