summaryrefslogtreecommitdiff
path: root/postfix/purge-spam-from-queue.sh
blob: 97053ad00d9854163d8d5798b2e591b164933972 (plain)
  1. #!/bin/sh
  2. #
  3. # /etc/local-COMMON/postfix/purge-spam-from-queue.sh
  4. # Copyright 2002 Jonas Smedegaard <dr@jones.dk>
  5. #
  6. # $Id: purge-spam-from-queue.sh,v 1.3 2003-03-29 10:25:31 jonas Exp $
  7. #
  8. # Purge non-important mails hanging in the queue (probably because of bounce to full mailbox or spam rejections)
  9. #
  10. # TODO: Improve filter!
  11. #
  12. badmails=`mailq | egrep -v '^( |$|\(|-)' | egrep '(MAILER-DAEMON|@earthlink\.net|@yahoo\.com|@excite\.com|@hotmail\.com)$' | sed 's/[^[:alnum:]].*//'`
  13. for x in $badmails; do
  14. postsuper -d $x
  15. done