postfix Bash Script: Release “n” emails from hold
Posted by sgj700 on May 25, 2008 in Uncategorized |
#!/bin/bash
#release_n_emails_from_hold.sh
ls /var/spool/postfix/hold/ > /tmp/hold
COUNTER=0
RELEASE_MAX=10 #modify me as needed
RELEASED_N=0
for l in `cat /tmp/hold` ; do
if [ $COUNTER -lt $RELEASE_MAX ]; then
echo Unholding $l
let RELEASED_N=RELEASED_N+1
fi
let COUNTER=COUNTER+1
done
echo There were $COUNTER emails in the hold que. We released $RELEASED_N