I'm using what I learned over at https://stackoverflow.com/a/3176517/ to route mail()-commands in PHP on my local machine to a file. From the php.ini
:
sendmail_path ='tee /testmail/mail.txt'
But when I add an additional_parameter
([email protected]
) it generates an addtional file named [email protected]
with the content of the mail in the current folder.
A complete example:
$ cat | php -d sendmail_path='tee /testmail/mail.txt'
<?php
mail('[email protected]', 'subject', 'body', '', '[email protected]');
?>
To: [email protected]
Subject: subject
body
The last five lines are written to /testmail/mail.txt
and and newly created [email protected]
.
It seems that the -f
-parameter gets forwarded to the tee
-command. Is there a way to prevent that?
(Using cat
results in an error and PHP returns false
.)