1
1
Fork 0
scripts/mail.sh

57 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
###############################
# #
# mbots mail routine #
# #
###############################
# ***** config section *****
#don't touch as long as you're not me. feel me?
version=".01"
author="david@socialnerds.org"
#script config
smtpserver="smtp.aec.at"
recipients="david@aec.at gerald.hochhauser@aec.at michael.grausgruber@aec.at daniel.weihrauch@aec.at"
from="mbots@aec.at"
subject="free memory on prix.aec.at"
line=$1
#if [ -f $line ]; then
# line=$(cat $line)
#fi
# ***** start of script *****
#telnet connection
{
sleep 1
echo "HELO $HOSTNAME"
sleep 1
echo "MAIL FROM: $from"
sleep 1
for address in $recipients; do
echo "RCPT TO: $address"
sleep 1
done
echo "DATA"
sleep 1
for address in $recipients; do
echo "To: $address"
done
echo "From: Monitoring Bots <$from>"
echo "Subject: $subject"
sleep 1
echo "$line"
sleep 1
echo "."
sleep 1
echo "QUIT"
} | telnet $smtpserver 25
# ***** end of script *****
#live long and prosper
exit 0