Created
February 16, 2014 11:21
-
-
Save StyleT/9032704 to your computer and use it in GitHub Desktop.
Sendmail handler (SH edition)
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
#!/bin/sh | |
# Script save all letters from PHP mail function to mailFolder | |
# Usage: in php.ini - sendmail_path = /path/to/sendmail.sh | |
# TODO: detect curr folder and save files to it | |
mailFolder="/Users/StyleT/sendmail" | |
now=$(date +"%m-%d-%Y_%H-%M-%S") | |
num=0 | |
name="$mailFolder/$now-$num.eml" | |
while [ -f name ] | |
do | |
num=$(($num + 1)) | |
name="$mailFolder/$now-$num.eml" | |
done | |
while read line | |
do | |
echo $line >> $name | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment