473,406 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

parse mime

I have a question about how to parse out mime from a message. I have email
messages that are stored in a database table and these messages have mime
headers embedded within them. How can I parse out this mime content and
retrieve only the text messages?

Thank you,
Erik
Jul 17 '05 #1
3 7694
Erik Rosenbach wrote:
I have a question about how to parse out mime from a message. I have email
messages that are stored in a database table and these messages have mime
headers embedded within them. How can I parse out this mime content and
retrieve only the text messages?


You mean you want to get rid of the header of the message?

The body of the e-mail message is the text after the first blank line.

That's easy to program.

Edwin Martin.

--
http://www.bitstorm.org/
Jul 17 '05 #2
Thanks Edwin for the answer, unfortunately it will not be that simple of a
process. What I have to work with is actually about 80K records coming out
of an Oracle database. These records (message bodies) are from an Lyris
News group server and I am porting them into something else. One of the key
problems with the content and the embedded mime is that I have some messages
with multipart headers... for text, html, and for attachments. I'm not
worried about any of the attachments, I just want to scrape the content.
Not every message is embedded with the mime either. Some of them are plain
text which is fine. The really problematic messages are the messages in
which people have posted the messaged and replied to. Some of these
messages have long trail of "original message" headers in them as well.

What I would ideally like to find, is a email parser I can passed the
message body to, and have it return to me a only the plain text body.

Thanks,
Erik

"Edwin Martin" <e.********@chello.nl> wrote in message
news:O9*****************@amsnews05.chello.com...
Erik Rosenbach wrote:
I have a question about how to parse out mime from a message. I have
email messages that are stored in a database table and these messages
have mime headers embedded within them. How can I parse out this mime
content and retrieve only the text messages?


You mean you want to get rid of the header of the message?

The body of the e-mail message is the text after the first blank line.

That's easy to program.

Edwin Martin.

--
http://www.bitstorm.org/

Jul 17 '05 #3
Erik Rosenbach wrote:
Thanks Edwin for the answer, unfortunately it will not be that simple of a
process. What I have to work with is actually about 80K records coming out
of an Oracle database. These records (message bodies) are from an Lyris
News group server and I am porting them into something else. One of the key
problems with the content and the embedded mime is that I have some messages
with multipart headers... for text, html, and for attachments. I'm not
worried about any of the attachments, I just want to scrape the content.
Not every message is embedded with the mime either. Some of them are plain
text which is fine. The really problematic messages are the messages in
which people have posted the messaged and replied to. Some of these
messages have long trail of "original message" headers in them as well.

What I would ideally like to find, is a email parser I can passed the
message body to, and have it return to me a only the plain text body.


Ah, I see, that's a little bit more complex.

This functionality might be part of some Mail software/API.

Maybe you can find a solution here:

http://java.sun.com/products/javamail/Third_Party.html

Edwin Martin.

--
http://www.bitstorm.org/
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Nik Coughin | last post by:
Is there something that I can do from cpanel so that php will parse not only ..php files, but also files with .html and .css extensions? -- "Come to think of it, there are already a million...
8
by: Spartanicus | last post by:
The document at http://homepage.ntlworld.com/spartanicus/custom_dtd.htm uses a custom DTD, the w3c validator validates it but with this warning: "Unknown Parse Mode! The MIME Media Type...
0
by: Klaus Bonadt | last post by:
I would like to parse an email, which I receive from a pop3 account. While the subject and the sender's email address are probably easy to determine, the body seems to be more difficult because of...
7
by: amfr | last post by:
I was wondering how i could parse the contents of a file into an array. the file would look something like this: gif:image/gif html:text/html jpg:image/jpeg .... As you can see, it contains...
2
by: Li-fan Chen | last post by:
Hi, We find ourselves in the unenviable position of creating an email reader, may I ask how we best parse incoming messages? Ideally we would point the parser at a email stored in a POP3--grab...
3
by: Nobody | last post by:
I'm trying to put together code to deal with a SOAP with attachements response, and I'd like to process the response in a single pass. The SOAP with attachments specification returns XML in a MIME...
3
by: staeri | last post by:
I'm using the following code to receive information from a web service: Dim o As New MyWebServiceProxyClient.DataImport Dim r As New MyWebServiceProxyClient.DataImportCompanyResult r =...
2
by: pmarg212 | last post by:
Greetings, I currently have incoming email piped to a php script using a .forward file. I would like to be able to parse the incoming mail, perform operations, and then fire back an email...
24
by: Gary Hasler | last post by:
I want apache to parse all .html files for php code. Our 'real' web server is rented from ICDsoft ( php 5 on Apache on Linux whatever), and their instruction is to add the following to the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.