File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change 17
17
*/
18
18
class SendmailMailer implements Mailer
19
19
{
20
- public ? string $ commandArgs = null ;
20
+ public string $ commandArgs = '' ;
21
21
private ?Signer $ signer = null ;
22
22
23
23
@@ -47,21 +47,19 @@ public function send(Message $mail): void
47
47
: $ tmp ->generateMessage ();
48
48
$ parts = explode (Message::EOL . Message::EOL , $ data , 2 );
49
49
50
+ $ cmd = $ this ->commandArgs ;
51
+ if ($ from = $ mail ->getFrom ()) {
52
+ $ cmd .= ' -f ' . key ($ from );
53
+ }
54
+
50
55
$ args = [
51
56
(string ) $ mail ->getEncodedHeader ('To ' ),
52
57
(string ) $ mail ->getEncodedHeader ('Subject ' ),
53
58
$ parts [1 ],
54
59
$ parts [0 ],
60
+ $ cmd ,
55
61
];
56
62
57
- if ($ from = $ mail ->getFrom ()) {
58
- $ args [] = '-f ' . key ($ from );
59
- }
60
-
61
- if ($ this ->commandArgs ) {
62
- $ args [] = $ this ->commandArgs ;
63
- }
64
-
65
63
$ res = Nette \Utils \Callback::invokeSafe ('mail ' , $ args , function (string $ message ) use (&$ info ): void {
66
64
$ info = ": $ message " ;
67
65
});
You can’t perform that action at this time.
0 commit comments