Skip to content
This repository has been archived by the owner on Feb 6, 2022. It is now read-only.

Fixed custom sendmail command was never considered #286

Merged
merged 1 commit into from Jun 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions DependencyInjection/SwiftmailerExtension.php
Expand Up @@ -214,6 +214,7 @@ protected function configureMailerTransport($name, array $mailer, ContainerBuild
new Reference(sprintf('swiftmailer.mailer.%s.transport.buffer', $name)),
new Reference(sprintf('swiftmailer.mailer.%s.transport.eventdispatcher', $name)),
])
->addMethodCall('setCommand', [$mailer['command']])
->setConfigurator([new Reference(sprintf('swiftmailer.transport.configurator.%s', $name)), 'configure'])
;

Expand Down
2 changes: 1 addition & 1 deletion Tests/DependencyInjection/Fixtures/config/php/sendmail.php
Expand Up @@ -3,5 +3,5 @@
$container->loadFromExtension('swiftmailer', [
'transport' => 'sendmail',
'local_domain' => 'local.example.org',
'command' => '/usr/sbin/sendmail -bs',
'command' => '/usr/sbin/sendmail -t -i',
]);
2 changes: 1 addition & 1 deletion Tests/DependencyInjection/Fixtures/config/xml/sendmail.xml
Expand Up @@ -9,6 +9,6 @@
<swiftmailer:config
transport="sendmail"
local-domain="local.example.org"
command="/usr/sbin/sendmail -bs"
command="/usr/sbin/sendmail -t -i"
/>
</container>
2 changes: 1 addition & 1 deletion Tests/DependencyInjection/Fixtures/config/yml/sendmail.yml
@@ -1,4 +1,4 @@
swiftmailer:
transport: sendmail
local_domain: local.example.org
command: /usr/sbin/sendmail -bs
command: /usr/sbin/sendmail -t -i
5 changes: 5 additions & 0 deletions Tests/DependencyInjection/SwiftmailerExtensionTest.php
Expand Up @@ -92,6 +92,11 @@ public function testSendmailConfig($type)
$this->assertEquals('swiftmailer.mailer.default.transport.sendmail', (string) $container->getAlias('swiftmailer.mailer.default.transport'));

$this->assertEquals('local.example.org', $container->get('swiftmailer.mailer.default.transport')->getLocalDomain());

/** @var \Swift_SendmailTransport $transport */
$transport = $container->get('swiftmailer.transport');

$this->assertEquals('/usr/sbin/sendmail -t -i', $transport->getCommand());
}

/**
Expand Down