You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Niklas Therning <ni...@trillian.se> on 2007/01/02 09:40:56 UTC

Re: (Simple?) Question regarding mime4j

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


Re: (Simple?) Question regarding mime4j

Posted by Markus Weimer <ma...@gmail.com>.
Hi Niklas,

> 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).

Thank you very much!

Greetings,

Markus

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org