php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28904 imap_fetchstructure returns incomplete data when c-client 2004 installed
Submitted: 2004-06-24 00:35 UTC Modified: 2004-07-16 01:00 UTC
Votes:5
Avg. Score:4.8 ± 0.4
Reproduced:4 of 4 (100.0%)
Same Version:2 (50.0%)
Same OS:2 (50.0%)
From: jolyon at mways dot co dot uk Assigned:
Status: No Feedback Package: IMAP related
PHP Version: 4.3.6 OS: FreeBSD 4.7
Private report: No CVE-ID: None
 [2004-06-24 00:35 UTC] jolyon at mways dot co dot uk
Description:
------------
Our ISP upgraded from c-client 2002 to c-client 2004. Since then PHP has operated mostly correctly, but a call to imap_fetchstructure() now returns incomplete data. Data on message attachments is lost now.



Reproduce code:
---------------
fetch structure of message with imap_fetchstructure()
var_dump structure

Expected result:
----------------
The same script running against the same message from the same mailserver as below, but running from a working system:

object(stdClass)(12) {
  ["type"]=>
  int(1)
  ["encoding"]=>
  int(0)
  ["ifsubtype"]=>
  int(1)
  ["subtype"]=>
  string(5) "MIXED"
  ["ifdescription"]=>
  int(0)
  ["ifid"]=>
  int(0)
  ["bytes"]=>
  int(8099)
  ["ifdisposition"]=>
  int(0)
  ["ifdparameters"]=>
  int(0)
  ["ifparameters"]=>
  int(1)
  ["parameters"]=>
  array(1) {
    [0]=>
    object(stdClass)(2) {
      ["attribute"]=>
      string(8) "BOUNDARY"
      ["value"]=>
      string(46) "-MOQ10879031851708b4bc5063293a737936ca57809981"
    }
  }
  ["parts"]=>
  array(2) {
    [0]=>
    object(stdClass)(12) {
      ["type"]=>
      int(0)
      ["encoding"]=>
      int(1)
      ["ifsubtype"]=>
      int(1)
      ["subtype"]=>
      string(5) "PLAIN"
      ["ifdescription"]=>
      int(0)
      ["ifid"]=>
      int(0)
      ["lines"]=>
      int(6)
      ["bytes"]=>
      int(140)
      ["ifdisposition"]=>
      int(0)
      ["ifdparameters"]=>
      int(0)
      ["ifparameters"]=>
      int(1)
      ["parameters"]=>
      array(1) {
        [0]=>
        object(stdClass)(2) {
          ["attribute"]=>
          string(7) "CHARSET"
          ["value"]=>
          string(10) "ISO-8859-1"
        }
      }
    }
    [1]=>
    object(stdClass)(13) {
      ["type"]=>
      int(5)
      ["encoding"]=>
      int(3)
      ["ifsubtype"]=>
      int(1)
      ["subtype"]=>
      string(5) "PJPEG"
      ["ifdescription"]=>
      int(0)
      ["ifid"]=>
      int(0)
      ["bytes"]=>
      int(7550)
      ["ifdisposition"]=>
      int(1)
      ["disposition"]=>
      string(10) "ATTACHMENT"
      ["ifdparameters"]=>
      int(1)
      ["dparameters"]=>
      array(1) {
        [0]=>
        object(stdClass)(2) {
          ["attribute"]=>
          string(8) "FILENAME"
          ["value"]=>
          string(8) "curl.jpg"
        }
      }
      ["ifparameters"]=>
      int(1)
      ["parameters"]=>
      array(1) {
        [0]=>
        object(stdClass)(2) {
          ["attribute"]=>
          string(4) "NAME"
          ["value"]=>
          string(8) "curl.jpg"
        }
      }
    }
  }
}


Actual result:
--------------
This message contains an attachment, although you wouldn't think so from this var_dump

object(stdClass)(12) {
  ["type"]=>
  int(1)
  ["encoding"]=>
  int(0)
  ["ifsubtype"]=>
  int(1)
  ["subtype"]=>
  string(5) "MIXED"
  ["ifdescription"]=>
  int(0)
  ["ifid"]=>
  int(0)
  ["bytes"]=>
  int(8099)
  ["ifdisposition"]=>
  int(0)
  ["ifdparameters"]=>
  int(0)
  ["ifparameters"]=>
  int(1)
  ["parameters"]=>
  array(1) {
    [0]=>
    object(stdClass)(2) {
      ["attribute"]=>
      string(8) "BOUNDARY"
      ["value"]=>
      string(46) "-MOQ10879031851708b4bc5063293a737936ca57809981"
    }
  }
  ["parts"]=>
  array(1) {
    [0]=>
    object(stdClass)(12) {
      ["type"]=>
      int(0)
      ["encoding"]=>
      int(1)
      ["ifsubtype"]=>
      int(1)
      ["subtype"]=>
      string(5) "PLAIN"
      ["ifdescription"]=>
      int(0)
      ["ifid"]=>
      int(0)
      ["lines"]=>
      int(6)
      ["bytes"]=>
      int(140)
      ["ifdisposition"]=>
      int(0)
      ["ifdparameters"]=>
      int(0)
      ["ifparameters"]=>
      int(1)
      ["parameters"]=>
      array(1) {
        [0]=>
        object(stdClass)(2) {
          ["attribute"]=>
          string(7) "CHARSET"
          ["value"]=>
          string(10) "ISO-8859-1"
        }
      }
    }
  }
}


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-16 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 03:01:28 2024 UTC