Sendgrid strategy decoding issue with Content-Transfer-Encoding: base64
jhecking opened this issue · 0 comments
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.