Qual è il modello / logica dietro a generare UID per i messaggi quando si utilizza server POP3?

StackOverflow https://stackoverflow.com/questions/8337587

Domanda

Questa domanda è per curiosità, JavaMail API fornisce fornitore protocollo POP3 per i messaggi accesso POP3. C'è un metodo POP3Folder.getUID (messaggio) disponibili che stringa di ritorno ID univoco per un messaggio. Si ritorna, per esempio, nel seguente formato:

Esempio UID: 1322488254.15180.1.dummy1,S=703

Le mie domande sono:

  1. C'è qualche logica / modello / algoritmo dietro nel generare questo UID univoco per ogni messaggio?
  2. Ci sono di probabilità / probabilità di avere lo stesso UID per messaggi multipli? In altre parole, è questo davvero unico?
  3. E 'questo UID è generato dal provider di POP3 (JavaMail API) o restituito dal server POP3?

JavaMail API doc dice:

Return the unique ID string for this message, or null if not available. Uses the POP3 UIDL command.

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top