php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77082 Sequential imap_status returns previous folders totals
Submitted: 2018-10-30 00:39 UTC Modified: 2020-10-25 04:22 UTC
From: shafer_w2002 at yahoo dot com Assigned: cmb (profile)
Status: No Feedback Package: IMAP related
PHP Version: 7.2.11 OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2018-10-30 00:39 UTC] shafer_w2002 at yahoo dot com
Description:
------------
This bug is affecting 7.2.11 and 7.3.0RC4

If calling imap_status() on a series of mailboxes, if the mailbox has no emails in it, imap_status() returns the previous result.

I have also tried calling imap_gc() before calling imap_status() and this didn't help either.

Test script:
---------------
$folders = [
    '{localhost:143}INBOX',  // Has 3 emails, 2 unseen
    '{localhost:143}INBOX/NoEmails',  //  Has no emails
];

$connection = imap_open('{localhost:143}INBOX/NoEmails', 'user', 'password);

foreach ($folders as $folder) {
    $status = imap_status($connection, $folder, SA_ALL);  // Changing options has no effect on the result

    print_r($status);  // Always returns the results for INBOX
}

Expected result:
----------------
stdClass Object
(
    [flags] => 31
    [messages] => 3
    [recent] => 0
    [unseen] => 2
    [uidnext] => 1108
    [uidvalidity] => 1527875182
)

stdClass Object
(
    [flags] => 31
    [messages] => 0
    [recent] => 0
    [unseen] => 0
    [uidnext] => 1108
    [uidvalidity] => 1527875182
)

Actual result:
--------------
stdClass Object
(
    [flags] => 31
    [messages] => 3
    [recent] => 0
    [unseen] => 2
    [uidnext] => 1108
    [uidvalidity] => 1527875182
)

stdClass Object
(
    [flags] => 31
    [messages] => 3
    [recent] => 0
    [unseen] => 2
    [uidnext] => 1108
    [uidvalidity] => 1527875182
)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-10-16 15:15 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2020-10-16 15:15 UTC] cmb@php.net
I'm not able to reproduce this.  Is this still an issue for you
with any of the actively supported PHP versions[1]?

[1] <https://www.php.net/supported-versions.php>
 [2020-10-25 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Jan 19 00:01:23 2021 UTC