Unable to get message_ID for MimeMessage

Viewed 1667

I have a java program using Java Mail-1.5 that fetch and process message(email) of Gmail(IMAP). It works fine for most of the case, but for few messages when I try to get message_id using MimeMessage, it is giving me NULL. In that case I am not able to process the messages as messageID is unique for the messages.

String messageID = ((MimeMessage) msg).getMessageID(); //NULL for few messages.

Is there any other way to get message Id as I don't want to ignore such messages.

3 Answers
Related