2

I've been spending the last few days trying to find an easy way to parse what SendGrid is sending me. I'm trying to get it through AWS API Gateway then to a Lambda function to work with the data.

I tried with busboy but keep getting a boundary not found error even after setting the header type to "multipart/form-data; boundary=xYzZY"

Here's the request that I need to parse:

--xYzZY
Content-Disposition: form-data; name="dkim"

{@example-com.2wef01e50623.sfsmtp.com : pass}
--xYzZY
Content-Disposition: form-data; name="subject"

testing dispatch

--xYzZY
Content-Disposition: form-data; name="to"

inbouder@example.com
--xYzZY
Content-Disposition: form-data; name="spam_score"

0.737
--xYzZY
Content-Disposition: form-data; name="from"

Frank Violette <dude@example.com>
--xYzZY
Content-Disposition: form-data; name="sender_ip"

229.845.241.520

--xYzZY
Content-Disposition: form-data; name="envelope"

{"to":["inboundparse@example"],"from":"dude@example.com"}
--xYzZY
Content-Disposition: form-data; name="charsets"

{"to":"UTF-8","subject":"UTF-8","from":"UTF-8"}
--xYzZY
Content-Disposition: form-data; name="SPF"

none
--xYzZY--

Any help/guidance would be much appreciated!

0 Answers0