Created
March 21, 2020 15:21
-
-
Save zobzn/bcd11126f2b6c0d03a0653b8d4c89f72 to your computer and use it in GitHub Desktop.
This file contains 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 | |
// ini_set('sendmail_path', '/var/www/sendmail.php -t'); | |
$filedata = file_get_contents('php://stdin'); | |
$filename = realpath(dirname(__FILE__) . '/../data') . '/mail/' . date('Y-m-d-H-i-s') . '-' . md5($filedata) . '.eml'; | |
if (!is_dir(dirname($filename))) | |
{ | |
@mkdir(dirname($filename), 0777, true); | |
} | |
if (is_dir(dirname($filename)) && is_writable(dirname($filename))) | |
{ | |
@file_put_contents($filename, $filedata); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment