php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8734 Unable to send large emails, causes a GPF - small email work fine.
Submitted: 2001-01-16 07:40 UTC Modified: 2002-08-23 21:25 UTC
From: wayne dot cope at sitel dot co dot uk Assigned: hholzgra (profile)
Status: Closed Package: Mail related
PHP Version: 4.0.4pl1 OS: Windows NT 4
Private report: No CVE-ID: None
 [2001-01-16 07:40 UTC] wayne dot cope at sitel dot co dot uk
When sending attached files (test file is only 14K), a GPF is caused by the mail() function.  When the file is small (e.g. 1K) the function works fine.

I have checked the ini file settings and all seems fine, and have run the same code on version 4.0.4 and it also crashes then too.  I am unable to check on any other versions.  I would guess it's a similar problem to the other "malloc problem" in this section (bug report: 8360) as it would appear to be a memory issue.

Let me know if you need any more info...
Wayne Cope.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-01-16 08:25 UTC] wayne dot cope at sitel dot co dot uk
I have checked the source code for the Windows version of the mail() function and have determined that there is a 4K limit to the mail buffer - which is nowhere near enough.  The line is:

#define  MAIL_BUFFER_SIZE		(1024*4)	/* 4k buffer */

Which can be found in "sendmail.h" under the Win32 compilation.

I can't compile the code to check for sure, but it does look like this is the problem.

C'ya !
Wayne Cope

 [2001-01-16 11:47 UTC] wayne dot cope at sitel dot co dot uk
I have been able to make the change and recompile the code to use a 1Mb buffer, instead of a 4K buffer and the mail() function works fine now.

You need to change the line
#define  MAIL_BUFFER_SIZE		(1024*4)	/* 4k buffer */

to
#define  MAIL_BUFFER_SIZE		(1024*1024)	/* 1Mb buffer */

in file "sendmail.h" to make this function work.

Ideally, the buffer size should be calculated dynamically, but that'll take a bit longer of course !

Can someone try and pop this change into the next release please.

TTFN !
Wayne Cope

 [2001-01-30 05:03 UTC] sniper@php.net
reclassify

 [2001-06-22 18:33 UTC] hholzgra@php.net
see #11165
 [2002-04-10 19:10 UTC] dkrout at u dot washington dot edu
Was this bug fixed in 4.1.2?
-David
 [2002-04-11 05:49 UTC] wayne dot cope at sitel dot co dot uk
No, this has not been changed in 4.1.2.

I have downloaded the source code for release 4.1.2 and the buffer used for sending mail is still hardcoded to 4K, and so still causes a GPF when trying to send an email larger than 4K (a buffer very easily broken by sending attachments for example).

Wayne
 [2002-08-23 21:25 UTC] sniper@php.net
There were some fixes in this code..please try this snapshot:

http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

 [2003-05-06 07:06 UTC] hassi at palmdevsolution dot com
Hello PHP webmaster,
thanks for hellp php.net
 
note:knowing my english is bad
 
my name is Noureddine, i'm a chief developper in company "PalmDev Solution Informatique".
web site =http://www.palmdevsolution.com
 
Problem:
I have fixe the code in our web site to allow the user to attach 6 files inorder that the total size must be < = 200 ko. 
- upload_max_filesize = 200 ko
- post_max_size = 200 ko
 
the code is running good If i just attach 1,2 or 3 file.
but if i try to attach 4,5 or 6 file i have that error :
 
Warning: Msg too big in confirm_top_model.php on line 90
 
Note: (line 90: line of function email() )
 
I dont know what can i do for this problem
 
IT'S URGENT
 
Thanks to all
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 18:01:28 2024 UTC