-
-
Save adis-io/f75d3441936857cd36aa 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 | |
$input = file_get_contents('php://stdin'); | |
preg_match('|^To: (.*)|', $input, $matches); | |
$filename = tempnam('/var/log/mail', date('ymd-his-') . $matches[1] . '.'); | |
file_put_contents($filename, $input); |
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
vi /usr/local/bin/sendmail | |
# copy the above code in it | |
chmod 755 /usr/local/bin/sendmail | |
# it doesn't need to be "/var/log/mail" | |
# it can be any folder you like | |
# just change it in the sendmail-code above and here | |
mkdir -p /var/log/mail | |
chmod 777 /var/log/mail | |
# in php.ini change the sendmail_path | |
# which can also be done via .htaccess | |
sendmail_path = /usr/local/bin/sendmail |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment