honeybadger-io / incoming

Incoming! helps you receive email in your Rack apps.
https://www.honeybadger.io/
MIT License
309 stars 19 forks source link

Sendgrid strategy decoding issue with Content-Transfer-Encoding: base64 #10

Closed jhecking closed 10 years ago

jhecking commented 10 years ago

I've noticed an encoding issue for incoming emails with a Content-Transfer-Encoding: base64 header when handled by the Sendgrid strategy. My assumption is that the message content (text as well as html) is already being decoded by Sendgrid. But Sendgrid still passes on the orig. Content-Transfer-Encoding header and the Sendgrid strategy then passes the header when instantiating the Mail::Message instance. When we then access the mail's text content via mail.text_part.body.decoded the content is garbled because the Mail code applies Base64 decoding again to the content that is already decoded by Sendgrid.

I'm trying to get official confirmation from Sendgrid on the handling of the Content-Transfer-Encoding header here: https://community.sendgrid.com/sendgrid/topics/webhook_api_and_content_transfer_encoding_base64.