Mail Queue Administration

seachen

Verified User
Joined
Feb 3, 2007
Messages
491
My Mail Queue Administration got a lot of mail list.

all is Recipient(s) is same. i dont know which user send out.

i try to use command as below:

exim -bp | awk '/^ *[0-9]+[mhd]/{print "exim -Mrm " $3}' | bash

result:
[root@server27 ~]# exim -bp | awk '/^ *[0-9]+[mhd]/{print "exim -Mrm " $3}' | bash
bash: line 1: syntax error near unexpected token `newline'
bash: line 1: `exim -Mrm <[email protected]>'
[root@server27 ~]#

may i know what happen?
 
Try this script if you are running Centos (don't know if it works on others):
Code:
#!/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

Also have a look at this thread:
http://www.directadmin.com/forum/showthread.php?p=208942#post208942

Several commands are mentioned there.
 
Back
Top