[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Sheflug] Mail Check Script



Dear All

Anyone know what to do with this ?   Craig has written a script for my
net facing box so that it checks for outgoing mail every so often and
then connects if there's anything in the mail queue.

Looks as though Craig and myself have guessed the crontab setup the
wrong way around.

The checkmail script looks like this...

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#!/bin/hash

if test -f 'ls /var/spool/mqueue/* | head -n 1'
then
    #Send connect to send mail
    echo "mailcheck: Sending pending mail from mqueue"
    /usr/sbin/isdnctrl dial ippp0
fi
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If I do 'cd /usr/local/sbin' and then I do './mailcheck' the box
connects to the net if mail is queued.  If there's no mail it doesn't
connect.

However, crontab is set to check mail every 15 minutes.

It looks as though either mailcheck isn't working or crontab isn't
configured properly.

In /etc/crontab for the regular download of mail I have the
following line....

15 6-23 * * * root /usr/local/sbin/isdnctrl dial ippp0

this downloads mail and I don't have to touch anything.  The mailcheck
line that Craig's put in is....

*/15 * * * root /usr/local/sbin/mailcheck

as I say it looks as though this line isn't doing anything.  Should I
change the bit at the front which is "*/15" ?  The rest of the line is
OK and should work fine.  I want to check for queued mail every
fifteen minutes.

Thanks



Richard

---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word 
 "unsubscribe" in the body of the message. 

  GNU the choice of a complete generation.