Robert Schetterer wrote:
i was thinking more about a cron cript like this ( surly modified to the
hold issue )
What do mail-daemon messages have to do with junk placed in the HOLD
queue by a milter

Here's a dorky script I use to release mail on hold after a few days. I have some questionable header_checks that HOLD mail and don't want to keep mail on hold forever if I'm on vacation or whatever...

It can easily be modified to move mail elsewhere or just delete "old" mail. Caution: if you move the file without renaming it, keep it in the same filesystem to insure unique filenames.

Just run from cron a couple times a day.

----8X----
#!/bin/sh
# pf-releasehold - automatically release messages from
# the hold queue if they are greater than DAYSOLD days old.

PBIN=/usr/sbin
DAYSOLD=2

QUEUEDIR=`$PBIN/postconf -h queue_directory`
HOLDQUEUE=${QUEUEDIR}/hold
TMPFILE=/tmp/pfhold-$$

find ${HOLDQUEUE} -type f -mtime +${DAYSOLD} -print > ${TMPFILE}

if test -z ${TMPFILE}
  then echo 'nothing to release from hold'
       rm -f ${TMPFILE}
       exit
fi


# if we get this far, there must be something that needs to be released

for QUEUEPATH in `cat ${TMPFILE}`
do
QUEUEID=`basename ${QUEUEPATH}`

# change this line to adjust action
$PBIN/postsuper -H ${QUEUEID} 2>&1 |
   mail -s 'pf-releasehold' postmaster

done

rm -f ${TMPFILE}

----8X----


Of course, the better answer is:
If clamav-milter isn't doing what you need, use another milter. There are several milters that can interface to clamd.

  -- Noel Jones

Reply via email to