Yesterday a mail-server I am responsible for suffered an unintentional DoS from an (unwitting) third-party. Here’s a quick script for Exim4 to clear out a specific domain/user from your mailqueue.
#!/bin/sh
if [ $1 ]; then
echo "`exim4 -bpru | tr '\n' + | sed -e "s/++/=/g" | tr -d + |
tr = '\n' |
grep "$1" | awk {'print $3'} | xargs exim4 -Mrm |
wc -l` E-Mails deleted"
else
echo "If you want to delete ALL the `exim4 -bpc` E-Mails on mail queue, give this command:"
echo "exim4 -bpru | awk {'print $3'} | xargs exim4 -Mrm"
echo ""
echo "If you want to delete only mails with an specific sender/recipient, use:"
echo "$0 [sender/recipient]"
fi
April 4, 2007



















Sorry, no comments yet.