Giter VIP home page Giter VIP logo

Comments (5)

eshanholtz avatar eshanholtz commented on August 24, 2024

Hi @garydevenay

I noticed you're using http.DetectContentType(contents) to determine the content type, instead of reading the type parsed from the email by inbound.Parse. Is the content type parsed from the email using the inbound helper correct?

from sendgrid-go.

garydevenay avatar garydevenay commented on August 24, 2024

Hi @eshanholtz
Thanks for the reply. As I understand contents is a map[string][]byte containing the file contents with the filename as the key (Reference) Is there a separate property of ParsedEmail that contains the content type?

from sendgrid-go.

eshanholtz avatar eshanholtz commented on August 24, 2024

Ah, my apologies. There is a ParsedEmail.Headers property that reads headers from the email, but the Content-Type header you would end up reading from there is multipart/mixed. I was able to recreate your issue using http.DetectContentType on our test email attachments. I think the best path forward here would be to extend the inbound module to give Attachments its own ParsedAttachment struct type, with its own Headers, Filename, and Content properties. The Headers property would be populated based on the data in the emailPart's Header property.

This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.

from sendgrid-go.

garydevenay avatar garydevenay commented on August 24, 2024

@eshanholtz Created a PR for the above solution.

from sendgrid-go.

garydevenay avatar garydevenay commented on August 24, 2024

Update on the above:
The solution above (including my amendments) still doesn't actually work with attachments. All attachments that come through inbound parse are corrupt.

I can't make any more progress on this as I'm unable to test Inbound Parse's requests on a non-production environment and the provided unit tests aren't a reflection of Inbound Parse's POST request.

This either needs to be looked at by a core member or Twilio/Sendgrid need to supply us with a valid method of testing this locally, but the service does not work as it stands.

from sendgrid-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.