-
-
Save briandemant/55053becdf28f9759499682fc6172614 to your computer and use it in GitHub Desktop.
a fake sendmail script for testing mail related applications, can replace /usr/sbin/sendmail
This file contains 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 | |
# Source : https://github.com/Sanchiz/fake_sendmail.sh | |
prefix="/home/USERNAME/sendmail/new" | |
numPath="/home/USERNAME/sendmail" | |
if [ ! -f $numPath/email_numbers ]; then | |
echo "0" > $numPath/email_numbers | |
fi | |
emailNumbers=`cat $numPath/emailNumbers` | |
emailNumbers=$(($emailNumbers + 1)) | |
echo $emailNumbers > $numPath/emailNumbers | |
name="$prefix/letter_$emailNumbers.eml" | |
while IFS= read line; do | |
echo "$line" >> $name | |
done | |
chmod 777 $name | |
/bin/true |
This file contains 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 | |
# chmod 666 /var/mails.txt | |
# all mails will be stored in this file | |
MAILS_FILE='/var/mails.txt' | |
while read x | |
do | |
echo $x >> $MAILS_FILE | |
done | |
echo "----------------------" >> $MAILS_FILE | |
echo >> $MAILS_FILE | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment