title: imap_num_msg returning less count than actual emails in the inbox with pop protocol
body: <p>I am trying to process the bounced emails in phplist using a gmail's email as the bounce back address. When I tried to process bounces, I got stucked in the similar scenario as mentioned in this <a href="https://forums.phplist.com/viewtopic.php?f=24&amp;t=38210#p94473" rel="nofollow">Post - There are 250 bounces to process</a>. </p>
  
  <p>Phplist was able to fetch only 250 emails from my gmail's account. On further investigating phplists' code I came across this line of code that seems like the culprit. </p>
  
  <p><code>$num = imap_num_msg($link);</code> // get only count of 250</p>
  
  <p>Skipping more details. I wrote few lines of code to get the mail count using <code>imap</code> and <code>pop</code>. The pop version returns the wrong count whereas that returned by imap version is correct</p>
  
  <pre><code>$username = 'bounceemail@mydomain.com';
  $password = 'password';
  
  $hostname = '{imap.gmail.com:993/imap/ssl}INBOX';
  $inbox = imap_open($hostname,$username,$password);
  $num = imap_num_msg($inbox);
  echo $num; // prints 65,051 ( correct one)
  
  $hostname = '{pop.gmail.com:995/pop3/ssl}INBOX';
  $inbox = imap_open($hostname,$username,$password);
  $num = imap_num_msg($inbox);
  echo $num; // prints 250 as count ( wrong one)
  </code></pre>
  
  <p>I actually need to know why the counts are different for same email with different protocols. Also , All the help I found on internet related to phplist bounce processing explicitly ask to use the <code>{pop.gmail.com:995/pop3/ssl}INBOX</code> version. So I can't risk using the other version to process bounces. </p>