php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25333 symptom: mail() stripped chars from base64 data block
Submitted: 2003-08-31 16:45 UTC Modified: 2003-09-08 18:36 UTC
Votes:10
Avg. Score:5.0 ± 0.0
Reproduced:10 of 10 (100.0%)
Same Version:9 (90.0%)
Same OS:10 (100.0%)
From: ap at d-dt dot de Assigned:
Status: Closed Package: Mail related
PHP Version: 4.3.4-dev, 5.0.0b2-dev OS: win32 only
Private report: No CVE-ID:
 [2003-08-31 16:45 UTC] ap at d-dt dot de
Description:
------------
As of PHP 4.3.3 (Win) my mail class sends e-mails, which single stripped characters. The same code worked with 4.3.2 (Win)

Used mailserver is Sendmail 8.12.6 on separate FreeBSD 5.1

Sending the message head and -body to stdout or apache produces a correct Output, only the incoming results differs from the expected.

Reproduce code:
---------------
mail ($addressee, 'Subj: '.phpversion(), chunk_split(base64_encode(file_get_contents('Images/numbers.zip'))), $mime->head());

where $mime->head() are the MIME Headers. Two variants tested: using CRLF and singe LF ("\r\n", "\n")


Expected result:
----------------
Incoming mail by 4.3.3 (incorrect, missing char in line 2: sequence is .."Z8B5".., should by .."Z8HB5".. )...

6AZ0QAQoLzBw/GPw5JDx2LDgYDOHsFbMjAIWDj5xjZgHDEksh1tkNWwSNjg0
HmflkQthKJz4oIObx2ZVzMuLB9smqdh5vDixaVkTq6iTwZ8B5b59wu6aMgo
Jqa2cMuVTOI4mOjky82lu8HnRKMqMx+H9ZIYyalPmZeyal7hSWR0cmeXZWta
...
Incoming mail by 4.3.2

6AZ0QAQoLzBw/GPw5JDx2LDgYDOHsFbMjAIWDj5xjZgHDEksh1tkNWwSNjg0
HmflkQthKJz4oIObx2ZVzMuLB9smqdh5vDixaVkTq6iTwZ8HB5b59wu6aMgo
Jqa2cMuVTOI4mOjky82lu8HnRKMqMx+H9ZIYyalPmZeyal7hSWR0cmeXZWta
..


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-01 17:47 UTC] sniper@php.net
For me (and like said in bug #25346) PHP crashed while I tried to reproduce this.


 [2003-09-02 09:37 UTC] sniper@php.net
See also bug #25357
 [2003-09-02 10:54 UTC] ap at d-dt dot de
Yes, sometimes it also crashed with my code when I'd used
it via the command-line (php.exe, the cli-Version does not
always produces the crash), but it worked with php_mod.

I think it depends whether I have a null-messagebody or
null-Subject. (There were some situations where it crashes
and the "null-situation" was at least one of them)
 [2003-09-08 18:36 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 [2003-11-20 20:29 UTC] jdpohl at comcast dot net
php 4.3.2 (ISP=ImageLinkUSA) RedHat Linux

$f = file_get_contents($pdf_file);
$e = chunk_split(base64_encode($f));
$d = base64_decode($e);
$c = strcmp($f,$d);

$c is 1
Shouldn't the strings $f and $d be equal?

This appears to be the root of a problem with php 4.3.2 file attachments sent to outlook xp.
 [2004-05-28 20:15 UTC] ahs5sp at aol dot com
It appears in the window environment server 2003 IIS, that version 4.3.3 of PHP deletes every 1024 character from the outgoing email.

We are testing version 4.3.6 to confirm that it is fixed in this version.
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 19:01:51 2014 UTC