I am having a java application which processes a gmail inbox for some user replies, processes these replies and put them into database. I am currently facing a problem where I want to identify the user signatures in the email content, trim them off and store rest of the content in the database.

I am reading the email into a MimeMessage, getting content from that and processing it.

Is there any way to trim off the signatures from MimeMessage content or any header which can tell me that the email has user signature and the boundary from where it starts?

I have googled it out but found nothing on this. Any help would be greatly appreciated!. Thanks :)