php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5194 imap_fetchheader does not work with UIDs
Submitted: 2000-06-22 21:54 UTC Modified: 2000-06-28 11:07 UTC
From: daboo at cyrusoft dot com Assigned:
Status: Closed Package: IMAP related
PHP Version: 3.0.16 OS: linux/x86 RH6.2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: daboo at cyrusoft dot com
New email:
PHP Version: OS:

 

 [2000-06-22 21:54 UTC] daboo at cyrusoft dot com
In php3_imap_fetchheader (in the file functions/imap.c) a check is done to see that the passed-in message number is within the correct range of message numbers. However, it fails to take into account that the message number might actually be a UID if the flags parameter includes the FT_UID option. If FT_UID is set in the flags, the message number range check should be skipped.

The following change works:

old code:

    if (msgno->value.lval < 1) || (msgno->value.lval > imap_le_struct->imap_stream->nmsgs) {

new code:

    if (!(flags->value.lval & FT_UID) &&
        (msgno->value.lval < 1) || (msgno->value.lval > imap_le_struct->imap_stream->nmsgs)) {

NB A quick look at the PHP4 code indicates that this problem is resolved in a slightly different manner there. You may prefer the PHP4 fix rather than the one I've done.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-06-28 11:07 UTC] hholzgra at cvs dot php dot net
php4 code had already been backported shortly
after 3.0.16 was out
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 19:01:35 2025 UTC