Coder Social home page Coder Social logo

Comments (3)

eliottvincent avatar eliottvincent commented on July 21, 2024

Hey there! I noticed a line break between line 6 and 7, which is not supposed to happen. How was the email originally parsed? Via mailparser?

I removed the line break:

---------- Forwarded message ---------
From: Sender <[email protected]>
Date: Fri, 25 Feb 2022 at 18:08
Subject: Test Email
To: Recipient <[email protected]>
Cc: Recipient 1 <[email protected]>, Recipient 2 <[email protected]>, Recipient 3 <[email protected]>


Email Start Here...

And the result is now ok:

{
  "forwarded": true,
  "message": null,
  "email": {
    "body": "Email Start Here...",
    "from": {
      "address": "[email protected]",
      "name": "Sender"
    },
    "to": [
      {
        "address": "[email protected]",
        "name": "Recipient"
      }
    ],
    "cc": [
      {
        "address": "[email protected]",
        "name": "Recipient 1"
      },
      {
        "address": "[email protected]",
        "name": "Recipient 2"
      },
      {
        "address": "[email protected]",
        "name": "Recipient 3"
      }
    ],
    "subject": "Test Email",
    "date": "Fri, 25 Feb 2022 at 18:08"
  }
}

from email-forward-parser.

spib avatar spib commented on July 21, 2024

Thanks for the super-quick reply. We're receiving the messages via SendGrid's Inbound Parse webhook (https://docs.sendgrid.com/for-developers/parsing-email/setting-up-the-inbound-parse-webhook#example-default-payload) and using the plain-text version of the email.

It does seem to be a known issue that GMail will wrap plain-text to 78 characters (https://fix.lazyjeff.com/2013/02/why-does-gmail-wrap-text-in-my-emails.html).

Are you guys using the html version of the email or plain text?

from email-forward-parser.

eliottvincent avatar eliottvincent commented on July 21, 2024

Ok, in that case my advise would be to use a dedicated parser like mailparser and give it the raw email. As a result you will get a clean, un-wrapped text representing the email.
Then you can pass that text to email-forward-parser.

from email-forward-parser.

Related Issues (15)

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.