Problem when shut/start sendmail and mailscanner
Julian Field
mailscanner at ecs.soton.ac.uk
Mon Aug 19 18:49:00 IST 2002
At 18:44 19/08/2002, you wrote:
> > >The filenames are start with "df" and "xf", e.g. dfg7DBSLt13069 and
> > >xfg7DBSLt13069.
> > >
> > >Do you think what I can to delete this files ?
> >
> > The last thing sendmail does with a message is rename the xf to qf, so you
> > could do that. On www.sendmail.org there is a really good script to start
> > sendmail that cleans up the queue really well.
> >
>
>And when there is only "df" files in the mqueue.in directory ?
If there are only df files, you might as well delete them, as you certainly
don't have enough info to be able to deliver them.
>I don't found the script in www.sendmail.org.
Here's the relevant bit:
SENDMAIL=/opt/sendmail/current
QUEUE=/var/spool/mqueue
INQUEUE=/var/spool/mqueue.in
CF=$SENDMAIL/etc/sendmail.cf
# Install everything if necessary (needed after careless Sun patching)
[ -x $SENDMAIL/bin/install.sendmail ] && $SENDMAIL/bin/install.sendmail
# Make placeholders for status files
[ -d $SENDMAIL/var/status ] || mkdir $SENDMAIL/var/status
[ -f $SENDMAIL/var/sendmail.st ] || touch $SENDMAIL/var/sendmail.st
echo "Starting sendmail:\c"
echo " clean up queue\c"
for queuedir in $QUEUE $INQUEUE
do
cd $queuedir
# remove zero length qf files
for qffile in qf*
do
if [ -r $qffile ]; then
if [ ! -s $qffile ]; then
rm -f $qffile
fi
fi
done
# rename tf files to be qf if the qf does not exist
for tffile in tf*
do
qffile=`echo $tffile | sed 's/t/q/'`
# JKF 15/7/98 Put $qffile in quotes in case tffile = 'tf*'
if [ -r $tffile -a ! -f "$qffile" ]; then
mv $tffile $qffile
else
if [ -f $tffile ]; then
rm -f $tffile
fi
fi
done
# remove df files with no corresponding qf files
for dffile in df*
do
qffile=`echo $dffile | sed 's/d/q/'`
if [ -r $dffile -a ! -f $qffile ]; then
mv $dffile `echo $dffile | sed 's/d/D/'`
fi
done
# announce files that have been saved during disaster recovery
for xffile in [A-Z]f*
do
if [ -f $xffile ]; then
echo " <saved mail spool $xffile>\c"
fi
done
done
# Now actually start the damn thing...
#$SENDMAIL/bin/sendmail -q15m
#$SENDMAIL/bin/sendmail -bd -ODeliveryMode=queueonly
-OQueueDirectory=/var/spool/mqueue.in
--
Julian Field Teaching Systems Manager
jkf at ecs.soton.ac.uk Dept. of Electronics & Computer Science
Tel. 023 8059 2817 University of Southampton
Southampton SO17 1BJ
More information about the MailScanner
mailing list