phires / go-guerrilla

MIT License
112 stars 18 forks source link

How to get only the email content? #44

Open guilhem-martin opened 4 months ago

guilhem-martin commented 4 months ago

Hello!

I am searching for a function to return only the email content, without any header, only the decoded content of the message. So far, I use envelop.Data.String() that returns the full body, including headers and message content.

MIME-Version: 1.0
From: john@doe.org
To: john@doe.org
Date: 9 Jul 2024 08:54:26 +0000
Subject: Hello
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

My Email Content

Is there a function of kind "getDecodedEMailContent"? Or is it up to developer to parse the data and extract the content of the message based on content-type?

Thanks.

phires commented 4 months ago

Hi, at this point there is no MIME Parser of any kind implemented; it's on the roadmap. To extend the envelop.Data to return only the body should be trivial, I'll look into it!