Sunday, December 27, 2015

Delete Mail Queue

Delete Mail Queue

#!/bin/bash
# Search user, ip or content and delete
if (! test $1)
then
  echo "Usage: $0 IP or username"
  exit 1
fi
for i in 0 1 2 3 4 5 6 7 8 9 A B C D E F
do
echo "Go to directory $i"
cd /var/spool/postfix-deliver/deferred/$i ; grep $1 * | awk '{print $3}'| postsuper -c /etc/postfix-deliver/ -d-
done

No comments:

Post a Comment