Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parsing reply email to take only the latest part

In java mail, when i parse an replied email, how can I take only the latest message (the reply) and ignore the old ones?

like image 688
Cristian Holdunu Avatar asked Nov 13 '22 03:11

Cristian Holdunu


1 Answers

I think you're asking about parsing the text content of the message to ignore the parts that are just previous messages that have been included in the response.

There's no well-defined way to do this. You're going to need to apply some heuristics to try to guess which parts of the text are these "quoted" messages. A common convention is that these messages are lines that start with ">", but that's not universal nor guaranteed.

like image 105
Bill Shannon Avatar answered Nov 14 '22 22:11

Bill Shannon