Imap_num_msg returns fewer than the actual emails in the pop-up inbox

I am trying to process returned emails in phplist using gmail email address as return return address. When I tried to handle the bounces, I ended up in a similar scenario, as mentioned in this "Mail". There are 250 failures to process .

Phplist was able to receive only 250 emails from my gmail account. As I studied the phplists code further, I came across this line of code that seems guilty.

$num = imap_num_msg($link);// get only the number 250

Skip more details. I wrote a few lines of code to get a mail account using imapand pop. The pop version returns the wrong score, while the imap version is correct.

$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)

I really need to know why the counts are different for the same email with different protocols. In addition, all the help I found on the Internet related to phplist failure handling explicitly asks for the use of the version {pop.gmail.com:995/pop3/ssl}INBOX. Therefore, I cannot risk using a different version for failover.

+4
source share
1 answer

Gmail POP, 250-300 , . , : , 30 .

, Gmail, IMAP.

+3

Source: https://habr.com/ru/post/1616698/


All Articles