Bug #17801 Updated: $header can only contain header data, multilpe newlines are ignored

From: Date: Tue, 18 Jun 2002 17:15:34 +0000
Subject: Bug #17801 Updated: $header can only contain header data, multilpe newlines are ignored
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-11163@lists.php.net to get a copy of this message
ID: 17801 Updated by: mfischer@php.net -Summary: mail() with more than 4012 byte crashes Reported By: gabinunde@yahoo.de -Status: Feedback +Status: Open Bug Type: Mail related Operating System: W98, NT -PHP Version: 4.2.1 +PHP Version: CVS New Comment: Now that you sent me your script, I reflected the problem in the summary. The change was requested to many MTA problems which don' deal well with not-well-formed $headers. So the current (CVS HEAD) behaviour is: Make sure whatever it is (\r, \n or \r\n) it's always \r\n (which IS required for sending over SMTP which is the case for win32) and also removing multiple \r\n occurences because they would break the header. You seem to have been used this behaviour (which isn't documented). This can be fixed in user-space by crafting the $header carefully i.e. know where to stop and putting the rest in the $body. I can't say anything about the BC impact here (I haven't got much feedback since the rewrite, but I think I should be happy what I got), but it seems it shouldn't be ignored. I'm soon at the point were I'ld say I revert every change to mail() and create win32_mail_rfc_compliant() .. ;) Previous Comments: ------------------------------------------------------------------------ [2002-06-18 07:01:25] mfischer@php.net Please send a script, which tries to send mail with the mail() function and produces failure output directly to me mfischer@php.net as I'm likely the one who fucked this up, thx. ------------------------------------------------------------------------ [2002-06-18 06:38:08] gabinunde@yahoo.de First I tryed "php4-win32-STABLE-latest.zip" with PHP 4.2.2 as CGI and as module, but the same error accured with mail(). After I tryed "php4-win32-latest.zip" with PHP 4.3.0: -Apache works with this version only as module, not as CGI. -Now I can send mails with $header>4012 Byte, but the plain text of the message-body as well as the attachment are received as they were headers!!!!!!!! In the source-text of the received mail message and attachment are shown in bold like all the headers (From, To, Content-Type ect...). So one can't read the message and the attachment has 0 byte. I could send an example of such a mail. Gabi ------------------------------------------------------------------------ [2002-06-17 11:06:04] edink@php.net Several mail() problems have been fixed in the latest CVS version of PHP. Could you please try the latest non stable snapshot from http://snaps.php.net/win32/ ------------------------------------------------------------------------ [2002-06-17 10:52:38] gabinunde@yahoo.de On W98 and NT (Apache 2.0.35, PHP(as CGI) 4.1.1 and 4.2.1 tested) there is a problem sending multipart-mails: mail($to,$subject,"",$header); $header has been created like at http://phpwizard.net/resources/phpMisc/scripts/pretty/mail.php3 Until the lenght of $header is <= 4012 byte everything is working fine. Obove that limit PHP.EXE crashes (drwtsn32.log) and Apache reports: "Premature end of script headers...". Thanks Gabi ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=17801&edit=1

« previous php.bugs (#11163) next »