🔧
This commit is contained in:
@@ -49,7 +49,7 @@ class SendmailTransport extends AbstractTransport
|
||||
*
|
||||
* -f<sender> flag will be appended automatically if one is not present.
|
||||
*/
|
||||
public function __construct(string $command = null, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null)
|
||||
public function __construct(?string $command = null, ?EventDispatcherInterface $dispatcher = null, ?LoggerInterface $logger = null)
|
||||
{
|
||||
parent::__construct($dispatcher, $logger);
|
||||
|
||||
@@ -64,11 +64,12 @@ class SendmailTransport extends AbstractTransport
|
||||
$this->stream = new ProcessStream();
|
||||
if (str_contains($this->command, ' -bs')) {
|
||||
$this->stream->setCommand($this->command);
|
||||
$this->stream->setInteractive(true);
|
||||
$this->transport = new SmtpTransport($this->stream, $dispatcher, $logger);
|
||||
}
|
||||
}
|
||||
|
||||
public function send(RawMessage $message, Envelope $envelope = null): ?SentMessage
|
||||
public function send(RawMessage $message, ?Envelope $envelope = null): ?SentMessage
|
||||
{
|
||||
if ($this->transport) {
|
||||
return $this->transport->send($message, $envelope);
|
||||
@@ -113,7 +114,7 @@ class SendmailTransport extends AbstractTransport
|
||||
$this->stream->setCommand($command);
|
||||
$this->stream->initialize();
|
||||
foreach ($chunks as $chunk) {
|
||||
$this->stream->write($chunk);
|
||||
$this->stream->write($chunk, false);
|
||||
}
|
||||
$this->stream->flush();
|
||||
$this->stream->terminate();
|
||||
|
||||
Reference in New Issue
Block a user