Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ignitetch
GitHub Repository: ignitetch/advphishing
Path: blob/master/PHPMailer/test/fakesendmail.sh
738 views
1
#!/usr/bin/env bash
2
#Fake sendmail script, adapted from:
3
#https://github.com/mrded/MNPP/blob/ee64fb2a88efc70ba523b78e9ce61f9f1ed3b4a9/init/fake-sendmail.sh
4
5
#Create a temp folder to put messages in
6
numPath="${TMPDIR-/tmp/}fakemail"
7
umask 037
8
mkdir -p ${numPath}
9
10
if [ ! -f ${numPath}/num ]; then
11
echo "0" > ${numPath}/num
12
fi
13
num=`cat ${numPath}/num`
14
num=$((${num} + 1))
15
echo ${num} > ${numPath}/num
16
17
name="${numPath}/message_${num}.eml"
18
while read line
19
do
20
echo ${line} >> ${name}
21
done
22
exit 0
23
24