ID: 48201 User updated by: carsten_sttgt at gmx dot de Reported By: carsten_sttgt at gmx dot de Status: Open Bug Type: IMAP related Operating System: * PHP Version: 5.*, 6CVS (2009-05-09) New Comment:
Hi Jani, first I must correct my description. Curious I have not seen this, because in "Actual result" you see what happens. >> - with ENCBASE64, the Content-Transfer-Encoding is "base64" >> and the data is transfomed (correct) >> >> - with ENCQUOTEDPRINTABLE, the Content-Transfer-Encoding is >> "quoted-printable" and the data is transfomed must be: - with ENCBASE64, the Content-Transfer-Encoding is "base64" and no transforming is done. - with ENCQUOTEDPRINTABLE, the Content-Transfer-Encoding is "quoted-printable" and no transforming is done. In summary we can say, the current behavior is: - ENC7BIT: no header, no data encoding - ENC8BIT: header switch to ENCQUOTEDPRINTABLE and data is automatically encoded with "quoted-printable" - ENCBINARY: header switch to ENCBASE64 and data is automatically encoded with "base64" - ENCQUOTEDPRINTABLE: header set to ENCQUOTEDPRINTABLE and no data encoding. You must do the encoding yourself - ENCBASE64: header set to ENCBASE64 and no data encoding. You must do the encoding yourself - And I'm not be able, to use a real ENC8BIT/ENCBINARY as header and without this automatically data encoding. - And there is also no info in the manual about the current behavior of this function. (also the list of available body params is not complete in the manual) >> - with "8bit" (or "7bit"), I have a segmentation fault >> (PHP crashes). At the moment you have a crash with a wrong "encoding" and also with a wrong "type". This happens because an access to a not existent / initialized array key. > Patches are welcome. :) Well, to fix this possible crash is easy. Only I'm not sure, how to handle this problem. At the moment I'm printing a "Warning" and the function returns with "false". But it's also possible, to set the value in these cases to "x-unknown" and maybe print an additional "Notice". To allow a real ENC8BIT, ENCBINARY, looks like a "little" bit more work... Regards, Carsten Previous Comments: ------------------------------------------------------------------------ [2009-05-11 09:55:58] j...@php.net Patches are welcome. :) ------------------------------------------------------------------------ [2009-05-11 07:21:31] carsten_sttgt at gmx dot de > This bug might be actually bug in c-client though.. I guess it's more that PHP is just using rfc822_encode_body_7bit() to the whole message (topbod is including all bodies from each message part), instead of process each body part separately, according to the encoding which is set. rfc822_encode_body_7bit is forcing a 7bit transfer, and so ENC8BIT must switch to "quoted-printable". ------------------------------------------------------------------------ [2009-05-10 16:40:02] j...@php.net This bug might be actually bug in c-client though.. ------------------------------------------------------------------------ [2009-05-10 16:39:46] j...@php.net Thanks for that. Just want to get the version info right. Just FYI, whenever you know that a bug exists in certain branch, please update the version also. And HEAD is not that necessary at the moment, we can be quite sure it exists there if it exists in PHP_5_3. :) I updated the versions now. Please do same in other reports from now on. ------------------------------------------------------------------------ [2009-05-10 07:43:01] carsten_sttgt at gmx dot de > Please try using this CVS snapshot: I have test the above with: Version: 5.3.0RC3-dev Thu, 07 May 2009 13:08:08 +0000 Version: 5.2.10-dev Thu, 07 May 2009 11:42:06 +0100 (the latest binary snapshots which are available for VC6 x86 Thread Safe) (and my normal PHP 5.2.9 VC6 x86 Thread Safe) Can't test with: Version: 6.0.0-dev Thu, 07 May 2009 11:30:12 +0000 because "php_imap.dll" is missing in the zip. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/48201 -- Edit this bug report at http://bugs.php.net/?id=48201&edit=1