Meaningless Drivel is fun!
The moose likes Other JSE/JEE APIs and the fly likes Retrieving the last reply from a mail Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Retrieving the last reply from a mail" Watch "Retrieving the last reply from a mail" New topic

Retrieving the last reply from a mail

Mike Anna
Ranch Hand

Joined: Jul 08, 2007
Posts: 117

Currently I am using to fetch all the messages from a POP3 account that I have to poll. However, I am not aware of how/if I could fetch only a reply from a particular mail.
For ex., a mail is sent to a user and he replies to the mail. So the replied mail contains the originally sent mail too. I need only the users reply.
I was also thinking of demarcating it based on some special characters, but that wouldnt work if the user deleted the original mail.

Could you please guide me on .. if there is some way I can do it ?

Rob Spoor

Joined: Oct 27, 2005
Posts: 20050

Try using instead of folder.getMessages(). With a FromTerm or a FromStringTerm you can filter out all emails not sent by that user. I don't know how to proceed after that, but perhaps you can investigate the emails to see if they have any information. Especially the headers may be useful.

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: Retrieving the last reply from a mail
It's not a secret anymore!