Skip to content

Instantly share code, notes, and snippets.

@66Ton99
Created September 18, 2011 18:59
Show Gist options
  • Save 66Ton99/1225407 to your computer and use it in GitHub Desktop.
Save 66Ton99/1225407 to your computer and use it in GitHub Desktop.
Fake sendmail
#!/bin/sh
prefix="/home/mail"
numPath="$prefix/.num"
if [ ! -f $numPath ]; then
echo "0" > $numPath
chmod 0777 $numPath
fi
num=`cat $numPath`
num=$(($num + 1))
echo $num > $numPath
name="$prefix/letter_$num.eml"
echo "Return-Path: <forma@66Ton99.org.ua>" > $name
while read line
do
echo $line >> $name
done
chmod 0777 $name
/bin/true
@66Ton99
Copy link
Author

66Ton99 commented Jul 25, 2012

You have to replace sendmail_path in php.ini

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment