mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-12-26 17:31:52 +00:00
96d4a3ecf7
Due to historical reasons, the code is in subfolder "1". With SVN removal, we place the code back and remove the annoying "1" folder.
23 lines
474 B
Bash
23 lines
474 B
Bash
#!/usr/bin/env bash
|
|
#Fake sendmail script, adapted from:
|
|
#https://github.com/mrded/MNPP/blob/ee64fb2a88efc70ba523b78e9ce61f9f1ed3b4a9/init/fake-sendmail.sh
|
|
|
|
#Create a temp folder to put messages in
|
|
numPath="${TMPDIR-/tmp/}fakemail"
|
|
umask 037
|
|
mkdir -p $numPath
|
|
|
|
if [ ! -f $numPath/num ]; then
|
|
echo "0" > $numPath/num
|
|
fi
|
|
num=`cat $numPath/num`
|
|
num=$(($num + 1))
|
|
echo $num > $numPath/num
|
|
|
|
name="$numPath/message_$num.eml"
|
|
while read line
|
|
do
|
|
echo $line >> $name
|
|
done
|
|
exit 0
|