Skip to content

Commit af31a6f

Browse files
committed
Made sendmail command configurable
For #4001 Added simple test to cover config option.
1 parent 08b3950 commit af31a6f

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

.env.example.complete

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ MAIL_USERNAME=null
8080
MAIL_PASSWORD=null
8181
MAIL_ENCRYPTION=null
8282

83+
# Command to use when email is sent via sendmail
84+
MAIL_SENDMAIL_COMMAND="/usr/sbin/sendmail -bs"
85+
8386
# Cache & Session driver to use
8487
# Can be 'file', 'database', 'memcached' or 'redis'
8588
CACHE_DRIVER=file

app/Config/mail.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
'sendmail' => [
4040
'transport' => 'sendmail',
41-
'path' => '/usr/sbin/sendmail -bs',
41+
'path' => env('MAIL_SENDMAIL_COMMAND', '/usr/sbin/sendmail -bs'),
4242
],
4343

4444
'log' => [

tests/Unit/ConfigTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ public function test_snappy_paper_size_options_are_limited()
9696
$this->checkEnvConfigResult('EXPORT_PAGE_SIZE', 'a4', 'snappy.pdf.options.page-size', 'A4');
9797
}
9898

99+
public function test_sendmail_command_is_configurage()
100+
{
101+
$this->checkEnvConfigResult('MAIL_SENDMAIL_COMMAND', '/var/sendmail -o', 'mail.mailers.sendmail.path', '/var/sendmail -o');
102+
}
103+
99104
/**
100105
* Set an environment variable of the given name and value
101106
* then check the given config key to see if it matches the given result.

0 commit comments

Comments
 (0)