#!/bin/sh # cleanq.sh - clean the crap out of the postfix queue MYDOMAIN=jamespo.org.uk # try and deliver valid stuff 1st /usr/sbin/postqueue -s $MYDOMAIN sleep 10 MSGS=`/usr/sbin/postqueue -p | grep MAILER-DAEMON | cut -f1 --delimiter=" "` #echo $MSGS for msg in $MSGS; do /usr/sbin/postsuper -d $msg > /dev/null done