Problem when shut/start sendmail and mailscanner

Fernando L. M. Gonçalves flmg5855 at TJ.SC.GOV.BR
Tue Aug 20 22:43:03 IST 2002


> > > 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
> > >
> >
> >Sorry, but I don't understood this script. Where I put it ?
>
> Alter the first 4 lines to point at your configuration files and queues,
> and merge this in to your MailScanner startup script. You will want to
> change the end of the script as well, as that happens to be the right
> settings for me.
>
> You don't have to go to these lengths to clean the queue, it doesn't
> actually matter very much. None of the Unix/Linux distributions I have used
> do any of this. It's just what is considered "best practice" and might be
> useful if you worry about old dead mqueue.in/mqueue files.

The script moved all df* files to Df* files in the mqueue.in directory...  why ?

Fernando.



More information about the MailScanner mailing list