Is there a free open-source solution taking raw e-mail message (as a piece of text) and returning each header field, each attachment and the message body as separate fields?
views:
75answers:
3
+2
A:
Yes... For each language you pointed out, I've used the one in Python myself. Try perusing the library documentation for your chosen library.
(Note: You may be expecting a "nice", high-level library for this parsing... That's a tricky area, email has evolved and grown without much design, there are a lot of dark corners, and API's reflect that).
Arafangion
2010-06-20 04:17:54
+1
A:
Yes, this is a common task and there are a number of apis out there to help you.
If working with Java, I'd look at JavaMail.
If working with PHP, I'd look at PECL mailparse or Pear Mail.
labratmatt
2010-06-20 04:32:11
Hmm, judging by that tick, sounds like his real question was: "What is a good email parsing library for Java and PHP?"
Arafangion
2010-06-20 05:17:42
A:
javax.mail.internet.MimeMessage
protected void parse(InputStream is)
irreputable
2010-06-20 05:01:29