fakie_flip |
10-16-2006 10:19 PM |
sendmail wont send mail
I never received this email. I tried many times. What is the problem?
Code:
chris@debian:~$ banner -w80 "linux" | sendEmail -t christopher.lemire@gmail.com -f root@chris1.myftp.org -u "tux"
Reading message body from STDIN because the '-m' option was not used.
If you are manually typing in a message:
- First line must be received within 60 seconds.
- End manual input with a CTRL-D on its own line.
Oct 16 21:40:51 debian sendEmail[24656]: Message input complete.
Oct 16 21:40:59 debian sendEmail[24656]: Email was sent successfully!
chris@debian:~$
Nothing is wrong with my sendmail configuration if you are thinking that. My script runs fine by cron to email me about my system updates, and I receive the emails. This is it.
Code:
chris@debian:~$ cat myapt
#!/bin/bash
if [ `whoami` != "root" ]; then
echo "You must be root to execute this script."
exit
fi
apt-get update
apt-get upgrade -y
echo "----------------------------------------------" >> /tmp/mylog
echo "Apt successfully updated the system:" >> /tmp/mylog
echo $(date) >> /tmp/mylog
echo >> /tmp/mylog
ls -luh /var/cache/apt/archives/ >> /tmp/mylog
echo >> /tmp/mylog
cat /tmp/mylog | sendEmail -t christopher.lemire@gmail.com -f root@chris1.myftp.org -u "Re: Apt successful system update" -q
cat /tmp/mylog | tee -a /var/log/pkgsbyapt
rm -f /tmp/mylog
apt-get clean
exit 0
chris@debian:~$
|