james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niklas Therning <nik...@trillian.se>
Subject Re: (Simple?) Question regarding mime4j
Date Tue, 02 Jan 2007 08:40:56 GMT
Markus Weimer wrote:
> Hi List,
>
> since a week or so, I am trying to solve a seemingly simple problem:
> Given a database entry that contains an email as Text, find the body
> of the message. This boils down to:
>
> Given the String representation of the message, find the human-written
> part of the content.
>
> I'm not interested in attachments, S/MIME info etc, as I am doing
> natural language processing research: I just need the subject and the
> body, and the subject has been extracted by the kind guys who gave me
> the database.
>
> Mime4j seems to be able to do what I want, but I can't quite figure it
> out. The examples mentioned on the homepage[0] must solve this as a
> sub-problem. I wanted to learn from the source code of these examples,
> but they are not part of the source download :-(
>
> Can someone please provide me with an alternative option to download
> the source of the  examples or just paste the relevant part here?
>
> Thanks in advance and sorry if I ended up on the wrong list,

Please see the attached source code. It extracts all text/plain parts in
a mail. You will have to adapt it to read from a string (by wrapping
your string in an InputStream).

Sorry about the examples not being included in the download. This will
be sorted out once we're able release MIME4J 0.3. In the meantime you
can view the examples here (there's really only one at the moment):
http://svn.apache.org/viewvc/james/mime4j/trunk/examples/src/java/org/mime4j/samples/tree/MessageTree.java?view=markup


HTH

-- 
Niklas Therning
www.spamdrain.net


Mime
View raw message