php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80438 imap_msgno() incorrectly warns on valid UIDs in PHP 8.0.0
Submitted: 2020-11-28 15:30 UTC Modified: 2020-11-30 04:27 UTC
From: kenai dot whitt at extraale dot com Assigned: girgias (profile)
Status: Closed Package: IMAP related
PHP Version: 8.0.0 OS:
Private report: No CVE-ID: None
 [2020-11-28 15:30 UTC] kenai dot whitt at extraale dot com
Description:
------------
IMAP works in PHP 7.4.x and earlier. In PHP 8.0.0, it breaks by flooding the error log with this: "imap_msgno(): Bad message number"

I have asked about it here: https://stackoverflow.com/questions/65031547/what-has-changed-in-php-8-which-causes-imap-msgno-to-claim-bad-message-number

I was told to report this here.

Test script:
---------------
$message_number_array = imap_search($specific_mailbox_connection, 'ALL', SE_UID);

if (count($message_number_array))
{
    foreach ($message_number_array as $message_number)
    {
        $header_info = imap_headerinfo($specific_mailbox_connection, imap_msgno($specific_mailbox_connection, $message_number));
[...]


Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-11-28 15:31 UTC] girgias@php.net
-Assigned To: +Assigned To: girgias
 [2020-11-30 04:27 UTC] girgias@php.net
-Summary: IMAP has broken in PHP 8 when it worked in 7.4.x and earlier. +Summary: imap_msgno() incorrectly warns on valid UIDs in PHP 8.0.0 -Operating System: Windows/probably any +Operating System:
 [2020-11-30 04:27 UTC] girgias@php.net
I can't make a reproducible but I've figured out the root issue.

The function reuses a macro to check for invalid message numbers, something which does not apply to imap_msgno() as it works on a unique ID which might not be in order depending on the mailbox server.
 [2020-11-30 04:55 UTC] girgias@php.net
The following pull request has been associated:

Patch Name: Fix Bug #80438: imap_msgno() incorrectly warns and return false on valid UIDs in PHP 8.0.0
On GitHub:  https://github.com/php/php-src/pull/6468
Patch:      https://github.com/php/php-src/pull/6468.patch
 [2020-11-30 14:09 UTC] girgias@php.net
Automatic comment on behalf of girgias
Revision: http://git.php.net/?p=php-src.git;a=commit;h=0076b47326e53d98b5df56c5f970b2b5cc3d9b6d
Log: Fix Bug #80438: imap_msgno() incorrectly warns and return false on valid UIDs in PHP 8.0.0
 [2020-11-30 14:09 UTC] girgias@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 17:01:29 2024 UTC