From: php dot net dot alias at fremnet dot net Operating system: Linux PHP version: 5CVS-2007-08-08 (snap) PHP Bug Type: IMAP related Bug description: Consecutive calls to imap_mail_compose drops parameter arrays
Description: ------------ Consecutive calls to imap_mail_compose drops the arrays passed in parts[] Note the missing '; name="file1.ext"' and '; filename="file1.ext"' for the second echo in the actual result. I've tested (and had this tested) on several Linux versions and two windows versions. Before posting I built a Linux PHP from the latest snapshot. Reproduce code: --------------- $Envelope = array('date' => date('r')); $Parts = array( array('type' => TYPEMULTIPART, 'subtype' => 'mixed'), array('description' => 'file1.ext', 'type' => TYPEAPPLICATION, 'subtype' => 'octet-binary','encoding' => ENCBINARY, 'type.parameters' => array('name' => 'file1.ext'), 'disposition.type' => 'attachment', 'disposition' => array('filename' => 'file1.ext'), 'contents.data' => 'the contents of file1'), array('type' => TYPETEXT, 'subtype' => 'PLAIN', 'contents.data' => 'Any body will do') ); echo imap_mail_compose($Envelope, $Parts)."\n\n\n"; echo imap_mail_compose($Envelope, $Parts); Expected result: ---------------- Date: Wed, 08 Aug 2007 13:23:36 +1000 MIME-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY="8323328-1804289383-1186543416=:27980" --8323328-1804289383-1186543416=:27980 Content-Type: APPLICATION/octet-binary; name="file1.ext" Content-Transfer-Encoding: BASE64 Content-Description: file1.ext Content-Disposition: attachment; filename="file1.ext" dGhlIGNvbnRlbnRzIG9mIGZpbGUx --8323328-1804289383-1186543416=:27980 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Any body will do --8323328-1804289383-1186543416=:27980-- Date: Wed, 08 Aug 2007 13:23:36 +1000 MIME-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY="8323328-1804289383-1186543416=:27980" --8323328-1804289383-1186543416=:27980 Content-Type: APPLICATION/octet-binary; name="file1.ext" Content-Transfer-Encoding: BASE64 Content-Description: file1.ext Content-Disposition: attachment; filename="file1.ext" dGhlIGNvbnRlbnRzIG9mIGZpbGUx --8323328-1804289383-1186543416=:27980 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Any body will do --8323328-1804289383-1186543416=:27980-- Actual result: -------------- Date: Wed, 08 Aug 2007 13:24:15 +1000 MIME-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY="8323328-1804289383-1186543455=:27987" --8323328-1804289383-1186543455=:27987 Content-Type: APPLICATION/octet-binary; name="file1.ext" Content-Transfer-Encoding: BASE64 Content-Description: file1.ext Content-Disposition: attachment; filename="file1.ext" dGhlIGNvbnRlbnRzIG9mIGZpbGUx --8323328-1804289383-1186543455=:27987 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Any body will do --8323328-1804289383-1186543455=:27987-- Date: Wed, 08 Aug 2007 13:24:15 +1000 MIME-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY="8323328-846930886-1186543455=:27987" --8323328-846930886-1186543455=:27987 Content-Type: APPLICATION/octet-binary Content-Transfer-Encoding: BASE64 Content-Description: file1.ext Content-Disposition: attachment dGhlIGNvbnRlbnRzIG9mIGZpbGUx --8323328-846930886-1186543455=:27987 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Any body will do --8323328-846930886-1186543455=:27987-- -- Edit bug report at http://bugs.php.net/?id=42240&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42240&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42240&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42240&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=42240&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=42240&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=42240&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=42240&r=needscript Try newer version: http://bugs.php.net/fix.php?id=42240&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=42240&r=support Expected behavior: http://bugs.php.net/fix.php?id=42240&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=42240&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=42240&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=42240&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42240&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=42240&r=dst IIS Stability: http://bugs.php.net/fix.php?id=42240&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=42240&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=42240&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=42240&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=42240&r=mysqlcfg