summaryrefslogtreecommitdiff
path: root/postfix/purge-spam-from-queue.sh
blob: 13b0a608b10e4744ae892c8244433b3f311ca48c (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.2 2002-12-31 13:38:42 jonas Exp $
  7. #
  8. # Purge non-important mails hanging in the queue (probably because of bounce to full mailbox)
  9. #
  10. # TODO: Improve filter!
  11. #
  12. badmails=`mailq | egrep -v '^( |$)' | egrep '@(earthlink\.net|yahoo\.com|excite\.com|hotmail\.com)' | sed 's/[^[:alnum:]].*//'`
  13. for x in $badmails; do
  14. postsuper -d $x
  15. done