>we get LOTS of spam these days, probably like everyone else, so to  
>keep the size of the quarantine down, it'd be nice if all spam caught  
>after n days was automatically deleted.

This works for me, relies on archivemail.

Edit the script to reflect your environment.

#!/bin/bash
#
# Usage:
#    age_spam_quarantine

DAYS=5                                  # Messages left in quarantine
older 
                                        # than this many days will be
                                        # deleted.
DATA=/var/spool/dspam/data              # DSpam data directory
ARCHIVEMAIL="/usr/bin/archivemail"      # Path to utility

# For each user mailbox...
for mbox in `find ${DATA} -follow -name *mbox`
do
    if [ -s $mbox ]; then
        # Tell archivemail to remove the messages.
        ${ARCHIVEMAIL} --days=${DAYS} --delete --include-flagged --quiet
$mbox
    fi;
done

D.

Reply via email to