This question is out of curiosity, JavaMail API provides POP3 protocol provider to access POP3 messages. There is a method POP3Folder.getUID(message) available that return unique ID string for a message. It returns, for example, in the following format:
Example UID: 1322488254.15180.1.dummy1,S=703
My questions are:
UID
uniquely for each messages?JavaMail API doc says:
Return the unique ID string for this message, or null if not available. Uses the POP3 UIDL command.
It's generated by the POP3 server. Every server does it differently. How perfectly it does it depends on the server, but generally I wouldn't worry about getting the same UID for two different messages. Depending on anything about the content or structure of the UID would be a mistake. In particular, don't assume that they're sorted.