email-parser | simple library provides ability to separate the quotation | Email library
kandi X-RAY | email-parser Summary
kandi X-RAY | email-parser Summary
This simple library provides ability to separate the quotation from the useful content in email messages. The main purpose of this library is to process as much different quotation formats as possible. It is also independent from the language used in email. Efficiency estimation we have got during testing: > 97.5 % correctly processed emails. For now it works only with text/plain Content-Type. Other content-types may be added later (you are welcome to make a pull request).
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of email-parser
email-parser Key Features
email-parser Examples and Code Snippets
Community Discussions
Trending Discussions on email-parser
QUESTION
I've set up SES to receive emails on my domain and then store the emails to S3. I trigger an SNS notification when a new email has arrived which triggers a lambda to do processing with the contents inside the email. Everything works as expected however, I'm not able to get any sensible data out of the emails I fetch from S3. For instance, getting an object from S3 of the email gives me this data :
...ANSWER
Answered 2019-Nov-06 at 18:00Yes, you need a parser.
Amazon SES will store incoming emails in S3 in RFC822 format, meaning exactly as they are received from the wire. This is by definition plain text, no matter how complex the email, even if it has attachments. Somewhere inside that RFC822 text piece there may or may not be some HTML in the body. An email's body can be plain text only, it can be HTML (most common) or it can be both.
You'll need to use a library which can parse RFC822. There are quite many of those. Which one to use will depend on your language choice. You'll also need to familiarize yourself with the anatomy of an Internet email message, i.e. RFC822. You'll find a wealth of information on that with a bit of googling. Suggestion: Your own email client can most likely save an email in RFC822 format and then you can use that as an example of what an email truly looks like in its 'native' format. Just have a look at it in your favorite text viewer.
Your question can be rephrased into an RFC822 parsing question. Some people refer to such files as .eml
files. Same thing.
Happy hunting.
QUESTION
ANSWER
Answered 2017-Nov-15 at 21:24The body of the message is MIME-encoded - that's why it contains the text in both plaintext and HTML formats. In order to get just the plaintext of the body, you first need to MIME-decode the message. You can use python's email package to do the MIME-decoding. Also, see this question for more information.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install email-parser
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page