[ILUG] another useful laptop bit...
kevin lyda
kevin at suberic.net
Thu Jan 20 21:28:32 GMT 2000
add this line:
O DeliveryMode=d
to your sendmail.cf. (or use an mc file, or the install-sendmail
script) that way there'll be no problem when you're not connected.
then write a shell script to go through your queue when you're
connected.
normally i'm only online when my ip address is 192.168.5.xxx, and the
ppp0 interface is up on my home machine named inle. the following
confirms all this and if so it runs /usr/lib/sendmail -q to send all my
email. then have crontab (see man 5 crontab) fire it off.
---snip---
#!/bin/sh
#####
# Is there mail to send?
mailtosend=`mailq|wc -l`
if [ $mailtosend -eq 1 ]; then
exit 0;
fi
#####
# Am I connected at home?
/sbin/ifconfig eth0 > /dev/null 2>%1
if [ $? -eq 0 ]; then
/sbin/ifconfig eth0|grep -q 192.168.5
if [ $? -eq 0 ]; then
rsh inle /sbin/ifconfig | grep -q ppp0
if [ $? -eq 0 ]; then
/usr/lib/sendmail -q
fi
fi
fi
---snip---
kevin
--
kevin at suberic.net Nutrition Facts
fork()'ed on 37058400 Puns: 100% RDA (% good puns: 0)
More information about the ILUG
mailing list