qcleaner
Take back control of your queue!


qcleaner is an addon perl utility for mail servers and exchangers that run qmail with qmail-scanner. It effectively cleans the queue by scanning the directory for bounces, then checks if the message is either spam (as tagged by spamassassin) or a qmail-scanner report for illegal characters/ breaks/comments, and if proven, it will modify the atime and mtime of the info file to a (user-defineable) time in the past. So the next time the queued bounced message is processed and delivery fails, it will finally bounce it to the local postmaster. This effectively reduced my queue to about 400% the first time I ran it.

qcleaner will only scan for preprocessed bounced messages. Only messages from <> will be opened, nothing more. It will only scan the first 100 lines of the message to match the pattern defined in the script which are patterns that prove that the message is indeed spam or a qmail-scanner report.

Safe mode is achieved by setting a variable in the script to 0. If safe mode is on, no modification will be done on any file in the queue, qcleaner will just scan the queue and log the queued bounced messages it would have modified if it's not in safe mode. This is a good way of finding out if qcleaner will be effective for the site.

HOW TO USE:
run qcleaner as root:

# ./qcleaner

This will scan your queue directory. A logfile will be generated at /tmp/qcleaner.log.

By default: 
- qcleaner will run in safe mode.  So there's no need to worry about it 
  modifying messages in your queue.  Set $revertit to 1 to revert.
- qcleaner will make a queued message as a candidate for atime/mtime revert
  after spending $ripetime seconds in the queue.
- qcleaner will only open messages that are from <>
- qcleaner will only scan the first 100 lines of the file in mess directory

You may want to run this via root's cron every 5 minutes. No hard and fast rules though.

DOWNLOAD!

SourceForge.net Logo