From:             [EMAIL PROTECTED]
Operating system: RedHat Linux 8.0
PHP version:      4.2.3
PHP Bug Type:     IMAP related
Bug description:  imap_fetchstructure() not correctly handling multipart messages

With the newest c-client version (IMAP-2002.RC10), imap_fetchstructure()
does not appear to correctly handle multipart messages.  The following
example message:

=====

Return-Path: <[EMAIL PROTECTED]>
Delivered-To: [EMAIL PROTECTED]
Received: from localhost (localhost [127.0.0.1])
        by bigworm.colorado.edu (Postfix) with ESMTP id D56241096
        for <[EMAIL PROTECTED]>; Tue, 12 Nov 2002 10:42:17 -0700
(MST)
Received: from bigworm.colorado.edu ([127.0.0.1]) by localhost
(bigworm.colorado.edu [127.0.0.1]) (amavisd-new) with ESMTP id 19282-10
for <[EMAIL PROTECTED]>; Tue, 12 Nov 2002 10:42:16 -0000 (MST)
Received: from wopr.Colorado.EDU (wopr.Colorado.EDU [128.138.196.42])
        by bigworm.colorado.edu (Postfix) with ESMTP id 346A81095
        for <[EMAIL PROTECTED]>; Tue, 12 Nov 2002 10:42:16 -0700
(MST)
Received: from fac607.m0.net (fly.m0.net [209.11.137.109])
        by wopr.Colorado.EDU (8.12.5/8.12.4/UnixOps+Hesiod (wopr)) with SMTP id
gACHgCiM011342
        for <[EMAIL PROTECTED]>; Tue, 12 Nov 2002 10:42:12 -0700 (MST)
Message-ID: <[EMAIL PROTECTED]>
Date: Tue, 12 Nov 2002 09:42:08 -0800 (PST)
From: "priceline.com" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Short Notice Travel Deals from Priceline
Errors-To: [EMAIL PROTECTED]
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="---=_NEXT_f17957ffc2"


-----=_NEXT_f17957ffc2
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable

[snip]

-----=_NEXT_f17957ffc2
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable

[snip]

-----=_NEXT_f17957ffc2--

=====

produces the following output using imap_fetchstructure():

stdClass Object
(
    [type] => 1
    [encoding] => 0
    [ifsubtype] => 1
    [subtype] => ALTERNATIVE
    [ifdescription] => 0
    [ifid] => 0
    [lines] => 138762584
    [ifdisposition] => 0
    [ifdparameters] => 0
    [ifparameters] => 1
    [parameters] => Array
        (
            [0] => stdClass Object
                (
                    [attribute] => boundary
                    [value] => ---=_NEXT_f17957ffc2
                )

        )

    [parts] => Array
        (
        )

)

As can be seen, no additional object appear in the parts array (there
should be 2 additional stdObjects - one for each nested part).

The same problems occur (and can be verified by me) with multipart/mixed
messages also.

This message is correctly handled using an older version of UW c-client
(imap-2001a).  Additionally, a fresh compilation of pine using the latest
c-client also handles the this message correctly.  Thus, it doesn't
_appear_ to be a c-client issue (although my internal analysis of PHP and
IMAP code is admittedly very very weak).

PHP configuration line:
'./configure' '--with-apxs=/httpd/bin/apxs' '--with-mysql' '--without-gd'
'--with-gdbm' '--disable-short-tags' '--disable-debug'
'--with-config-file-path=/httpd/conf'
'--with-imap=/usr/local/src/c-client' '--with-imap-ssl' '--with-gettext'
'--enable-ftp' '--with-pear=/httpd/lib/php/pear'
'--enable-inline-optimization' '--with-mcrypt=/usr/local/libmcrypt'
'--with-zlib' '--with-domxml'
-- 
Edit bug report at http://bugs.php.net/?id=20401&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=20401&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=20401&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=20401&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=20401&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=20401&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=20401&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=20401&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=20401&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=20401&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=20401&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20401&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=20401&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=20401&r=isapi

Reply via email to