Skip to content

Instantly share code, notes, and snippets.

@udovicic
Created January 12, 2015 12:10
Show Gist options
  • Save udovicic/ace68802d9925b9de4f5 to your computer and use it in GitHub Desktop.
Save udovicic/ace68802d9925b9de4f5 to your computer and use it in GitHub Desktop.
Fake sendmail - write content to file
#!/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