very old messages in /var/spool/mqueue.in

Julian Field MailScanner at ecs.soton.ac.uk
Thu Nov 8 21:45:34 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



Scott Silva wrote:
> on 11/7/2007 11:36 PM Götz Reinicke spake the following:
>> Hi,
>>
>> what is qf/df :-? and is ther a way to do this kind of cleaning
>> automatically?
>>
>> Thanks and best regards
>>
>> Götz
> find /path/to/files* -mtime +5 -exec rm {} \;
>
> set /path/to/files* to the queue path and the 5 is the default
> amount of time that sendmail retries sending messages before giving
>  up. Adjust that amount to  what your system does. To be safe you
> could set it to +7.
>
> When the above is working properly, you can add it to a daily cron
> job.
>
There is an "official" answer from some very elderly sendmail
documentation. It runs like this:

- ------ CUT ------
cd $QUEUE

# 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
- ------ CUT ------

That's how I do it on my Sun boxes.

Jules

- --
Julian Field MEng CITP
www.MailScanner.info
Buy the MailScanner book at www.MailScanner.info/store

MailScanner customisation, or any advanced system administration help?
Contact me at Jules at Jules.FM

PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
For all your IT requirements visit www.transtec.co.uk
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHM4N+EfZZRxQVtlQRAk2TAJ9PiMOy0/hTSPN+h7aqRR+16m959QCg7Ipk
GLfGMzlYNPrJmb+8VUuTs/0=
=9Dy5
-----END PGP SIGNATURE-----


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
For all your IT requirements visit www.transtec.co.uk



More information about the MailScanner mailing list