delete from the mailq

shuttlebox shuttlebox at GMAIL.COM
Sat Dec 17 09:48:02 GMT 2005

    [ The following text is in the "ISO-8859-1" character set. ]
    [ Your display is set for the "US-ASCII" character set.  ]
    [ Some characters may be displayed incorrectly. ]

On 12/17/05, Jan Agermose <ja at> wrote:

      Does anyone have a script or something to delete mails in
      queue based on a regex? Or passing a mail address as sender
      or receiver address?

This is from, I
use it myself. He has some more advanced stuff to but this one works


if [ -z $@ ] ; then
   echo "Usage: $0 email_address"
   exit 1

for i in `(cd /var/spool/mqueue; grep -l "To:.*$1" qf* | cut -c3-)`
   mv /var/spool/mqueue/*$i /tmp/mqueue


------------------------ MailScanner list ------------------------
To unsubscribe, email jiscmail at with the words:
'leave mailscanner' in the body of the email.
Before posting, read the Wiki (
and the archives (

Support MailScanner development - buy the book off the website!

More information about the MailScanner mailing list