Redhat 8.0; sendmail-8.12.8-9.80; php 4.3.4; httpd-2.0.40-11.9
I have written a php script that e-mails via sendmail. When sending a message over 990 characters, a "! " followed by two carriage returns are inserted into the message. This "junk" is put every 990 character of the message. Sending the same message via sendmail through pine (a email client), works no problem. Also checking the string before sending to sendmail (the function below) and there is no problem there. It appears to be the popen and piping action to sendmail.
Here is my function I am using which appears on many sites without any complaints:
function sendmail($to='', $subject='', $message='', $headers='', $extra='') {
$fd = popen("/usr/sbin/sendmail -t $extra", 'w');
fputs($fd, "To: $to\n");
fputs($fd, "Subject: $subject\n");
fputs($fd, "Content-type: text/html\n");
fputs($fd, "X-Mailer: PHP4\n");
if ($headers)
fputs($fd, "$headers\n");
fputs($fd, "\n");
fputs($fd, $message);
pclose($fd);
}
At first I though it might be a pipe cache limit. Php wasn't compiled with thread safety if that has anything to do with it. Also tried on a RH 9 box and still had the same effect!
UPDATE
Piped the string to a file with no problems. Now I am completely stumped on what the problem might be; obviously sendmail.