diff --git a/src/Transport/Sendmail.php b/src/Transport/Sendmail.php index 855dfc1f..214e4271 100644 --- a/src/Transport/Sendmail.php +++ b/src/Transport/Sendmail.php @@ -85,9 +85,8 @@ public function setParameters($parameters) foreach ($parameters as $param) { $string .= ' ' . $param; } - trim($string); - $this->parameters = $string; + $this->parameters = trim($string); return $this; } diff --git a/test/Transport/SendmailTest.php b/test/Transport/SendmailTest.php index c1ad5518..ae205b22 100644 --- a/test/Transport/SendmailTest.php +++ b/test/Transport/SendmailTest.php @@ -9,6 +9,7 @@ namespace ZendTest\Mail\Transport; +use ReflectionProperty; use Zend\Mail\Message; use Zend\Mail\Transport\Exception\RuntimeException; use Zend\Mail\Transport\Sendmail; @@ -158,4 +159,14 @@ public function testValidEmailLocaDomainInFromHeader() $this->transport->send($message); $this->assertContains('From: Foo Bar <"foo-bar"@domain>', $this->additional_headers); } + + public function testTrimmedParameters() + { + $this->transport->setParameters([' -R', 'hdrs ']); + + $r = new ReflectionProperty($this->transport, 'parameters'); + $r->setAccessible(true); + + $this->assertSame('-R hdrs', $r->getValue($this->transport)); + } }