From: bob at midnightweb dot net Operating system: RedHat Linux 8.0 PHP version: 4.3.2 PHP Bug Type: IMAP related Bug description: imap_headerinfo returns only one address in To field
Description: ------------ The imap_headerinfo() function appears to only return the first address in the To field of messages that contain more than one address in that field. Addresses in the Cc field apear to be unaffected by this bug. I have tried upgrading the C-Client to 2002b-6, and then recompiling the latest stable PHP release ( 4.3.2 ). The examples are given with a message with the following To headers: -- Begin snipit -- From: "Bob" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> -- End snipit -- NOTE: The email addresses in this report have been altered to preserve the privacy of the user. Reproduce code: --------------- $mailbox = imap_open($servername.".$cfldr", $username, $password); $msgheader = @imap_headerinfo($mailbox, $msg); ob_start(); print_r( $msgheader ); error_log( ob_get_contents() ); ob_end_clean(); Expected result: ---------------- In the error_log of the web server, there should be a print_r output of the object returned by imap_headerinfo() that looks as follows with the "to" and "toaddress" elements: -- Begin assumed snipit -- [toaddress] => "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> [to] => Array ( [0] => stdClass Object ( [personal] => [EMAIL PROTECTED] [mailbox] => user [host] => mydomain.com ) [1] => stdClass Object ( [personal] => [EMAIL PROTECTED] [mailbox] => user2 [host] => mydomain.com ) [2] => stdClass Object ( [personal] => [EMAIL PROTECTED] [mailbox] => user3 [host] => mydomain.com ) ) -- End assumed snipit -- Actual result: -------------- There is the print_r output, however with incomplete "to" array and "toaddress" string elements: -- Begin snipit -- [toaddress] => "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> [to] => Array ( [0] => stdClass Object ( [personal] => [EMAIL PROTECTED] [mailbox] => user [host] => mydomain.com ) ) -- End snipit -- -- Edit bug report at http://bugs.php.net/?id=24490&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=24490&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=24490&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=24490&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=24490&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=24490&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=24490&r=support Expected behavior: http://bugs.php.net/fix.php?id=24490&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=24490&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=24490&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=24490&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24490&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=24490&r=dst IIS Stability: http://bugs.php.net/fix.php?id=24490&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=24490&r=gnused