Skip to content

Instantly share code, notes, and snippets.

@andreyp
Created August 5, 2011 08:02
Show Gist options
  • Save andreyp/1127096 to your computer and use it in GitHub Desktop.
Save andreyp/1127096 to your computer and use it in GitHub Desktop.
Fake Sendmail for testing
#!/bin/sh
prefix="/tmp/mail/sendmail/new"
numPath="/tmp/mail/sendmail"
if [ ! -f $numPath/num ]; then
echo "0" > $numPath/num
fi
num=`cat $numPath/num`
num=$(($num + 1))
echo $num > $numPath/num
name="$prefix/letter_$num.txt"
while read line
do
echo $line >> $name
done
chmod 777 $name
/bin/true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment