Questions on the process of extracting data from emails, including the handling of MIME types, attachments, and other embedded information.
Questions tagged [email-parsing]
127 questions
93
votes
11 answers
Parse email content from quoted reply
I'm trying to figure out how to parse out the text of an email from any quoted reply text that it might include. I've noticed that usually email clients will put an "On such and such date so and so wrote" or prefix the lines with an angle bracket. …

VanOrman
- 4,351
- 5
- 35
- 31
32
votes
3 answers
Java Email message Parser?
Is anyone familiar with a Java library that helps with parsing the fields (date, subject, from, to) of the email below?
Message-ID: <19815303.1075861029555.JavaMail.ss@kk>
Date: Wed, 6 Mar 2010 12:32:20 -0800 (PST)
From:…

Kareem
- 1,026
- 3
- 10
- 15
9
votes
1 answer
Installing mailparse php7 mbstring error
I'm currently working to put our project under php7.
When trying to compile the mailparse extension or use pecl to install it, I get this error:
#error The mailparse extension requires the mbstring extension!
I did install the php7.0-mbstring and…

Charles Teinturier
- 91
- 1
- 3
7
votes
4 answers
How can I parse email text for components like etc?
I'm writing an application that analyzes emails and it would save me a bunch of time if I could use a python library that would parse email text down into named components like etc.
For example, the…

Trindaz
- 17,029
- 21
- 82
- 111
7
votes
2 answers
Is there a non-deprecated equivalent of rfc822.AddressList?
I need something like rfc822.AddressList to parse, say, the content of the "TO" header field of an email into individual addresses. Since rfc822 is deprecated in favor of the email package, I looked for something similar there but couldn't find…

Chung Wu
- 2,357
- 3
- 21
- 19
6
votes
1 answer
How to read and parse email using npm-imap package in Node js
I went through many links but could not find complete solution anywhere to implement this.

Joobi S B
- 173
- 1
- 8
5
votes
2 answers
How do I get just the text content from a multipart email?
#!/usr/bin/php -q

Jimbo
- 51
- 1
- 1
- 3
5
votes
1 answer
Incorrect gmail parsing with node-imap and mailparser
I'm writing a Node.js script that retrieves unread emails from my gmail inbox using node-imap, parses them with mailparser, and then does some work with the parsed emails. I'm running into a problem where the raw email being received doesn't seem…

Jared
- 2,043
- 5
- 33
- 63
5
votes
1 answer
Splitting email text to conversation
I am writing an email parser in Python and looking for a way to extract all previous emails (forwarded, replied) from an email body. The script has to support as many email clients as possible (gmail, outlook, iphone, etc.). For example if the body…

Tzach
- 12,889
- 11
- 68
- 115
4
votes
3 answers
How do I parse emails in realtime as they are recieved
I need to build an email parsing script which would parse emails that would come into an inbox and dump the contents into a database, while at the same time make a curl request with details parsed from the email.
At this moment I'm quite stuck on…

Ali
- 7,353
- 20
- 103
- 161
4
votes
1 answer
HeaderParseError in python
I get a HeaderParseError if I try to parse this string with decode_header() in python 2.6.5 (and 2.7). Here the repr() of the string:
'=?iso-8859-1?B?QW5tZWxkdW5nIE5ldHphbnNjaGx1c3MgU_xkcmluZzNwLmpwZw==?='
This string comes from a mime email which…

guettli
- 25,042
- 81
- 346
- 663
4
votes
2 answers
node.js: mailparser not working
I want to parse an email and found mailparser package. (installed it using "npm install mailparser").
i'm using windows 7.
i'm trying to run the simple example but the "end" event is not called and i don't see any logs.
this is what i run:
const…

Yoni Mayer
- 1,212
- 1
- 14
- 27
4
votes
5 answers
Is there any open source tool that automatically 'detects' email threading like Gmail?
For instance, if the original message (message 1) is...
Hey Jon,
Want to go get some pizza?
-Bill
And the reply (message 2) is...
Bill,
Sorry, I can't make lunch today.
Jonathon Parks, CTO Acme Systems
On Wed, Feb 24, 2010 at 4:43 PM,…

Chris W.
- 37,583
- 36
- 99
- 136
4
votes
1 answer
How to parse HTML from eMail body - Python
I'm trying to parse incoming emails in python.
I get emails which are part text part HTML.
I want to get the HTML part and find a table in the HTML.
I tried using beatifulsoup. But when trying the next code, the bs only get the first "" part and not…

skme
- 731
- 6
- 24
3
votes
0 answers
Can I extract only the body text of an eml file?
I need to extract just the text in the body of an eml file but my code keeps giving me some code text and the folders that exist in Outlook. I am working with Python 2.7 and BeautifulSoup.
My code is:
import email
from email import…

K.Malamatas
- 31
- 3