title: What happens if number of messages in mail inbox exceed int range?
body: <p>I have to read new e-mails constantly with JavaMail using POP3.</p>
  
  <p>I'm going to implement such solution:</p>
  
  <ul>
  <li>count all mails (once, at the start of application)</li>
  <li>set <code>lastRead</code> to mails number</li>
  <li>periodically poll inbox and then:
  
  <ul>
  <li>count all mails and check if their number is greater than <code>lastRead</code></li>
  <li>if so, read new mails and update <code>lastRead</code></li>
  </ul></li>
  </ul>
  
  <p>It works fine at small sample, but I wonder what happens if the number of mails on the server exceed 2147483647.</p>
  
  <p>I see that if I delete mail (from common client), it has no impact of number of mails returned by server to JavaMail or their numbers. But what if the mailbox will overflow? Will I have to stop and start application again?</p>
  
  <p>The methods of Folder have <code>int</code>s as arguments (I think about <code>getMessages</code>, which I use). Is this ever possible for mailbox to have so many messages? Or maybe these ids are just reseting in some way? But this also won't be to good for my application.</p>