FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=16527&edit=1

ID: 16527
Updated by: daniel.oconnor@gmail.com
Reported By: amrnablus at gmail dot com
Summary: missing parenthesis cause the last part of message to
be parsed wrong
Status: Open
Type: Bug
Package: Net_IMAP
Operating System: all
Package Version: 1.1.0
PHP Version: Irrelevant
Roadmap Versions:
New Comment:

Got a test script? Otherwise it's pretty hard to judge the affect /
value of your changes for us not familiar with the package.


Previous Comments:
------------------------------------------------------------------------

[2009-08-16 09:05:05] amrnablus

Description:
------------
when fetching a message part, the code that searches for the brace has
missing parenthesis which causes size and the body to be parsed in a
wrong way ...

------------------------------------------------------------------------

Search Discussions

  • Amrnablus at Aug 17, 2009 at 10:26 am
    Edit report at http://pear.php.net/bugs/bug.php?id=16527&edit=1

    ID: 16527
    Updated by: amrnablus@gmail.com
    Reported By: amrnablus at gmail dot com
    Summary: missing parenthesis cause the last part of message to
    be parsed wrong
    Status: Open
    Type: Bug
    Package: Net_IMAP
    Operating System: all
    Package Version: 1.1.0
    PHP Version: Irrelevant
    Roadmap Versions:
    New Comment:

    check this out ,

    fetch the message from server with nc

    1 fetch 1 (FLAGS UID INTERNALDATE RFC822.SIZE body.peek[header.fields
    (From To Subject )]) body[2]
    * 1 FETCH (FLAGS () UID 948 INTERNALDATE "06-Aug-2009 12:55:12 +0000"
    RFC822.SIZE 939 BODY[HEADER.FIELDS (FROM TO SUBJECT)] {154}
    Subject: =?UTF-8?B?SGk=?=
    From: =?UTF-8?B?Iklzc2EgRmFraG91cnkiPGlzc2FfZmFraG91cnlAbWFrdG9vYi4=?=
    =?UTF-8?B?Y29tPg==?=
    To: undisclosed-recipients:;

    )

    sample script:
    $imap = new Net_IMAP( $host );
    $imap->login( $user , $password );
    $ids = array( "1" );//, "5" );
    $uidString = implode( "," , $ids );

    $res = $imap->cmdFetch( $uidString , "(FLAGS UID INTERNALDATE
    RFC822.SIZE body.peek[header.fields (From To Subject X-Maktoob)])
    body[2]" );

    var_dump( $res['PARSED'] );die( );


    the output without the fix ( note ["CONTENT_SIZE"] )
    array(1) {
    [0]=>
    array(3) {
    ["COMMAND"]=>
    string(5) "FETCH"
    ["NRO"]=>
    string(1) "1"
    ["EXT"]=>
    array(5) {
    ["FLAGS"]=>
    array(0) {
    }
    ["UID"]=>
    string(3) "948"
    ["INTERNALDATE"]=>
    string(26) "06-Aug-2009 12:55:12 +0000"
    ["RFC822.SIZE"]=>
    string(3) "939"
    ["BODY[HEADER.FIELDS (FROM TO SUBJECT X-MAKTOOB)]"]=>
    array(2) {
    ["CONTENT"]=>
    string(154) "4}
    Subject: =?UTF-8?B?SGk=?=
    From: =?UTF-8?B?Iklzc2EgRmFraG91cnkiPGlzc2FfZmFraG91cnlAbWFrdG9vYi4=?=
    =?UTF-8?B?Y29tPg==?=
    To: undisclosed-recipients:;"
    ["CONTENT_SIZE"]=>
    string(189) "154}
    Subject: =?UTF-8?B?SGk=?=
    From: =?UTF-8?B?Iklzc2EgRmFraG91cnkiPGlzc2FfZmFraG91cnlAbWFrdG9vYi4=?=
    =?UTF-8?B?Y29tPg==?=
    To: undisclosed-recipients:;

    )
    "0006 OK Fetch completed.
    }
    }
    }


    output after the fix is applied
    array(1) {
    [0]=>
    array(3) {
    ["COMMAND"]=>
    string(5) "FETCH"
    ["NRO"]=>
    string(1) "1"
    ["EXT"]=>
    array(5) {
    ["FLAGS"]=>
    array(0) {
    }
    ["UID"]=>
    string(3) "948"
    ["INTERNALDATE"]=>
    string(26) "06-Aug-2009 12:55:12 +0000"
    ["RFC822.SIZE"]=>
    string(3) "939"
    ["BODY[HEADER.FIELDS (FROM TO SUBJECT X-MAKTOOB)]"]=>
    array(2) {
    ["CONTENT"]=>
    string(154) "Subject: =?UTF-8?B?SGk=?=
    From: =?UTF-8?B?Iklzc2EgRmFraG91cnkiPGlzc2FfZmFraG91cnlAbWFrdG9vYi4=?=
    =?UTF-8?B?Y29tPg==?=
    To: undisclosed-recipients:;

    "
    ["CONTENT_SIZE"]=>
    string(3) "154"
    }
    }
    }
    }


    Previous Comments:
    ------------------------------------------------------------------------

    [2009-08-16 16:15:12] doconnor

    Got a test script? Otherwise it's pretty hard to judge the affect /
    value of your changes for us not familiar with the package.

    ------------------------------------------------------------------------

    [2009-08-16 09:05:05] amrnablus

    Description:
    ------------
    when fetching a message part, the code that searches for the brace has
    missing parenthesis which causes size and the body to be parsed in a
    wrong way ...

    ------------------------------------------------------------------------
  • Sam at Aug 30, 2009 at 7:21 am
    Edit report at http://pear.php.net/bugs/bug.php?id=16527&edit=1

    ID: 16527
    Comment by: sam@archives.org.au
    Reported By: amrnablus at gmail dot com
    Summary: missing parenthesis cause the last part of message to
    be parsed wrong
    Status: Open
    Type: Bug
    Package: Net_IMAP
    Operating System: all
    Package Version: 1.1.0
    PHP Version: Irrelevant
    Roadmap Versions:
    New Comment:

    I have applied this patch and can confirm that it works.


    Previous Comments:
    ------------------------------------------------------------------------

    [2009-08-17 12:25:53] amrnablus

    check this out ,

    fetch the message from server with nc

    1 fetch 1 (FLAGS UID INTERNALDATE RFC822.SIZE body.peek[header.fields
    (From To Subject )]) body[2]
    * 1 FETCH (FLAGS () UID 948 INTERNALDATE "06-Aug-2009 12:55:12 +0000"
    RFC822.SIZE 939 BODY[HEADER.FIELDS (FROM TO SUBJECT)] {154}
    Subject: =?UTF-8?B?SGk=?=
    From: =?UTF-8?B?Iklzc2EgRmFraG91cnkiPGlzc2FfZmFraG91cnlAbWFrdG9vYi4=?=
    =?UTF-8?B?Y29tPg==?=
    To: undisclosed-recipients:;

    )

    sample script:
    $imap = new Net_IMAP( $host );
    $imap->login( $user , $password );
    $ids = array( "1" );//, "5" );
    $uidString = implode( "," , $ids );

    $res = $imap->cmdFetch( $uidString , "(FLAGS UID INTERNALDATE
    RFC822.SIZE body.peek[header.fields (From To Subject X-Maktoob)])
    body[2]" );

    var_dump( $res['PARSED'] );die( );


    the output without the fix ( note ["CONTENT_SIZE"] )
    array(1) {
    [0]=>
    array(3) {
    ["COMMAND"]=>
    string(5) "FETCH"
    ["NRO"]=>
    string(1) "1"
    ["EXT"]=>
    array(5) {
    ["FLAGS"]=>
    array(0) {
    }
    ["UID"]=>
    string(3) "948"
    ["INTERNALDATE"]=>
    string(26) "06-Aug-2009 12:55:12 +0000"
    ["RFC822.SIZE"]=>
    string(3) "939"
    ["BODY[HEADER.FIELDS (FROM TO SUBJECT X-MAKTOOB)]"]=>
    array(2) {
    ["CONTENT"]=>
    string(154) "4}
    Subject: =?UTF-8?B?SGk=?=
    From: =?UTF-8?B?Iklzc2EgRmFraG91cnkiPGlzc2FfZmFraG91cnlAbWFrdG9vYi4=?=
    =?UTF-8?B?Y29tPg==?=
    To: undisclosed-recipients:;"
    ["CONTENT_SIZE"]=>
    string(189) "154}
    Subject: =?UTF-8?B?SGk=?=
    From: =?UTF-8?B?Iklzc2EgRmFraG91cnkiPGlzc2FfZmFraG91cnlAbWFrdG9vYi4=?=
    =?UTF-8?B?Y29tPg==?=
    To: undisclosed-recipients:;

    )
    "0006 OK Fetch completed.
    }
    }
    }


    output after the fix is applied
    array(1) {
    [0]=>
    array(3) {
    ["COMMAND"]=>
    string(5) "FETCH"
    ["NRO"]=>
    string(1) "1"
    ["EXT"]=>
    array(5) {
    ["FLAGS"]=>
    array(0) {
    }
    ["UID"]=>
    string(3) "948"
    ["INTERNALDATE"]=>
    string(26) "06-Aug-2009 12:55:12 +0000"
    ["RFC822.SIZE"]=>
    string(3) "939"
    ["BODY[HEADER.FIELDS (FROM TO SUBJECT X-MAKTOOB)]"]=>
    array(2) {
    ["CONTENT"]=>
    string(154) "Subject: =?UTF-8?B?SGk=?=
    From: =?UTF-8?B?Iklzc2EgRmFraG91cnkiPGlzc2FfZmFraG91cnlAbWFrdG9vYi4=?=
    =?UTF-8?B?Y29tPg==?=
    To: undisclosed-recipients:;

    "
    ["CONTENT_SIZE"]=>
    string(3) "154"
    }
    }
    }
    }

    ------------------------------------------------------------------------

    [2009-08-16 16:15:12] doconnor

    Got a test script? Otherwise it's pretty hard to judge the affect /
    value of your changes for us not familiar with the package.

    ------------------------------------------------------------------------

    [2009-08-16 09:05:05] amrnablus

    Description:
    ------------
    when fetching a message part, the code that searches for the brace has
    missing parenthesis which causes size and the body to be parsed in a
    wrong way ...

    ------------------------------------------------------------------------

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedAug 16, '09 at 2:15p
activeAug 30, '09 at 7:21a
posts3
users3
websitepear.php.net

3 users in discussion

Daniel Oconnor: 1 post Amrnablus: 1 post Sam: 1 post

People

Translate

site design / logo © 2022 Grokbase