Created
November 12, 2011 05:16
-
-
Save christianchristensen/1360081 to your computer and use it in GitHub Desktop.
Drupal quickstart sendmail/email .txt dump script
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 | |
$content = file_get_contents('php://stdin'); | |
preg_match('|^To: (.*)|', $content, $address); | |
$filename = "/home/quickstart/websites/logs/mail/" . date('Y-m-d_H:i:s') . '--' . $address[1] . '.txt'; | |
file_put_contents($filename, $content); | |
chmod($filename, 0666); | |
exit(); | |
?> | |
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
# Configure email collector | |
# Taken from: http://drupalcode.org/project/quickstart.git/blob/refs/heads/7.x-1.x:/quickstart-6-devenv.sh#l176 / http://drupalcode.org/project/quickstart.git/blob/refs/heads/7.x-1.x:/config/sendmail.php | |
mkdir -p /home/quickstart/websites/logs/mail | |
chmod -R 777 /home/quickstart/websites/logs/mail | |
sudo sed -i 's/;sendmail_path =/sendmail_path=\/home\/quickstart\/quickstart\/config\/sendmail.php/g' /etc/php5/apache2/php.ini /etc/php5/cli/php.ini | |
chmod +x /home/quickstart/quickstart/config/sendmail.php |
If you're running Drupal and have SMTP settings you may need to force them off:
In your settings.php
file look for smtp_library
:
$conf['smtp_library'] = NULL;
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note this is altering
sendmail_path
inphp.ini
sendmail_path=/path/to/sendmail.php