how to clear the whole of the exim q?

txt3rob

Verified User
Joined
Jan 16, 2007
Messages
101
i need to clear over a 1k emails in my exim queue how can i do this in one go?
 
i need to clear over a 1k emails in my exim queue how can i do this in one go?

Use this script:
Code:
[root@sv03 ~]# cat empty_exim_que.sh
#!/bin/sh

if [ $1 ]; then
        echo "`exim -bpru | tr '\n' + | sed -e "s/++/=/g" | tr -d + | tr = '\n' | grep "$1" | awk {'print $3'} | xargs exim -Mrm | wc -l` E-Mails deleted"
else
        echo "If you want to delete ALL the `exim -bpc` E-Mails on mail queue, give this command:"
        echo "exim -bpru | awk {'print $3'} | xargs exim -Mrm"
        echo ""
        echo "If you want to delete only mails with an specific sender/recipient, use:"
        echo "$0 [sender/recipient]"
fi
 
Back
Top