PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Mail » Mail » Bug #8543

Missing newline after headers when using sendmail

Details

Submitted2006-08-23 17:07 UTC
Fromrobin dot west at dal dot ca
Assignedjon
StatusClosed
PackageMail
PHP Version4.3.2
OSRH Linux 2.4.21-40.EL.D01smp #1
Roadmaps(Not assigned)

Comments

[2006-08-23 17:07 UTC] robin dot west at dal dot ca

Description:
------------
During a recent system update, our PEAR Mail package was updated to 1.1.10. After the update, we noticed an error message being displayed by our Webmail application (Horde/IMP v4.0.3). This was due to bug 7682 (Use of undefined constant PHP_EOL). We checked your CVS and noticed that this bug was fixed so we updated the Mail package to the CVS version.

However, we now have a more serious bug: there is no newline inserted after the message headers when using the "sendmail" driver. Message lines that start with spaces, or with a single word followed by a colon (:), end up being interpreted as headers and disappear from the message body.

After reviewing your CVS, we're pretty sure this is happening because of the "fix" put in for bug 7492, which removed the newline from the Mail.php file because there was already a newline being inserted in the "mail" driver. However, it appears there is no newline inserted by the "sendmail" driver, and so the message body gets mixed up with the text.

You can see our phpinfo() here:
http://mytest.dal.ca/webmail/phpinfo.php

Test script:
---------------
<?php

include('Mail.php');

/* change addresses as needed for testing */
$recipients = 'rwest@dal.ca';

$headers['From'] = 'rwest@dal.ca';
$headers['Subject'] = 'Test message';

$body = 'Line1: 1
Line2: 2
Line3: 3

LineX: X
LineY: Y
LineZ: Z
';

$mail_object =& Mail::factory('sendmail');

var_dump($mail_object->send($recipients, $headers, $body));

?>

Expected result:
----------------
Date: Wed, 23 Aug 2006 13:50:10 -0300 [01:50:10 PM ADT]
From: rwest@dal.ca
Subject: Test message

Line1: 1
Line2: 2
Line3: 3

LineX: X
LineY: Y
LineZ: Z

Actual result:
--------------
Date: Wed, 23 Aug 2006 13:50:24 -0300 [01:50:24 PM ADT]
From: rwest@dal.ca
Subject: Test message

LineX: X
LineY: Y
LineZ: Z

[2006-09-13 13:54 UTC] robin dot west at dal dot ca

Hi - we are using sendmail v8.12.11.20060308 on RH Linux 2.4.21-40.EL.D01smp #1.

-Robin