This commit is contained in:
2025-05-12 14:25:25 +02:00
parent ab2db755ef
commit 9e378ca2b7
2719 changed files with 46505 additions and 60181 deletions

View File

@@ -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();