Created
January 12, 2015 12:10
-
-
Save udovicic/ace68802d9925b9de4f5 to your computer and use it in GitHub Desktop.
Fake sendmail - write content to file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
/** | |
* Fake mail sending: log content to file | |
* | |
* Instructions: | |
* 1. Save as /usr/sbin/sendmail | |
* 2. Make it executable | |
*/ | |
$date = new DateTime(); | |
$file = '/tmp/fakemail_'.$date->format('d-m-Y_H:i:s').'.log'; | |
$log = fopen ($file,'a+'); | |
fwrite($log,file_get_contents("php://stdin")); | |
fclose($log); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment