SoFunction
Updated on 2025-03-10

Shell scripts implement deletion of mail queues


#/bin/bash
######################################
#  touched by lingyun1 on 2014-12-01  #
######################################
#Define the blocked mail file path
quepath=/var/spool/mqueue
#Click the number of blocked email files
filenum=`ls $quepath|wc -l`
#If it is greater than 100, start deleting blocked email files
if [ $filenum -ge 100 ];then
    find $quepath -type f -name '*' -print0 | xargs -0 rm
    rm -rf $quepath/*
fi