Index: library/Zend/Mail/Transport/Sendmail.php =================================================================== --- library/Zend/Mail/Transport/Sendmail.php (revision 18227) +++ library/Zend/Mail/Transport/Sendmail.php (working copy) @@ -164,6 +164,9 @@ // Prepare headers parent::_prepareHeaders($headers); + + // Fix issue with empty blank line ontop when using Sendmail Trnasport + $this->header = rtrim($this->header); } } Index: tests/Zend/Mail/MailTest.php =================================================================== --- tests/Zend/Mail/MailTest.php (revision 18227) +++ tests/Zend/Mail/MailTest.php (working copy) @@ -223,6 +223,22 @@ } /** + * @group ZF-7799 + */ + public function testHeaderSendMailTransportHaveNoRightTrim() + { + $mail = new Zend_Mail("UTF-8"); + $mail->setBodyText('My Nice Test Text'); + $mail->addTo("foobar@example.com"); + $mail->setSubject("hello world!"); + + $transportMock = new Zend_Mail_Transport_Sendmail_Mock(); + $mail->send($transportMock); + + $this->assertEquals($transportMock->header, rtrim($transportMock->header)); + } + + /** * Check if Header Fields are stripped accordingly in sendmail transport; * also check for header injection * @todo Determine why this fails in Windows (testmail3@example.com example)