8000 bug #286 Fixed custom sendmail command was never considered (Toflar) · symfony/swiftmailer-bundle@cb125b3 · GitHub
[go: up one dir, main page]

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

Commit cb125b3

Browse files
committed
bug #286 Fixed custom sendmail command was never considered (Toflar)
This PR was merged into the 3.2-dev branch. Discussion ---------- Fixed custom sendmail command was never considered I tried configuring a different sendmail command in my Symfony application and noticed that it shows correctly when running `bin/console debug:config swiftmailer` but it's just never considered due to a missing `setCommand()` call on the transport. Commits ------- b8db015 Fixed custom sendmail command was never considered
2 parents 9594593 + b8db015 commit cb125b3

File tree

5 files changed

+9
-3
lines changed

5 files changed

+9
-3
lines changed

DependencyInjection/SwiftmailerExtension.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ protected function configureMailerTransport($name, array $mailer, ContainerBuild
214214
new Reference(sprintf('swiftmailer.mailer.%s.transport.buffer', $name)),
215215
new Reference(sprintf('swiftmailer.mailer.%s.transport.eventdispatcher', $name)),
216216
])
217+
->addMethodCall('setCommand', [$mailer['command']])
217218
->setConfigurator([new Reference(sprintf('swiftmailer.transport.configurator.%s', $name)), 'configure'])
218219
;
219220

Tests/DependencyInjection/Fixtures/config/php/sendmail.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
$container->loadFromExtension('swiftmailer', [
44
'transport' => 'sendmail',
55
'local_domain' => 'local.example.org',
6-
'command' => '/usr/sbin/sendmail -bs',
6+
'command' => '/usr/sbin/sendmail -t -i',
77
]);

Tests/DependencyInjection/Fixtures/config/xml/sendmail.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
<swiftmailer:config
1010
transport="sendmail"
E012
1111
local-domain="local.example.org"
12-
command="/usr/sbin/sendmail -bs"
12+
command="/usr/sbin/sendmail -t -i"
1313
/>
1414
</container>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
swiftmailer:
22
transport: sendmail
33
local_domain: local.example.org
4-
command: /usr/sbin/sendmail -bs
4+
command: /usr/sbin/sendmail -t -i

Tests/DependencyInjection/SwiftmailerExtensionTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ public function testSendmailConfig($type)
9292
$this->assertEquals('swiftmailer.mailer.default.transport.sendmail', (string) $container->getAlias('swiftmailer.mailer.default.transport'));
9393

9494
$this->assertEquals('local.example.org', $container->get('swiftmailer.mailer.default.transport')->getLocalDomain());
95+
96+
/** @var \Swift_SendmailTransport $transport */
97+
$transport = $container->get('swiftmailer.transport');
98+
99+
$this->assertEquals('/usr/sbin/sendmail -t -i', $transport->getCommand());
95100
}
96101

97102
/**

0 commit comments

Comments
 (0)
0