Victor Duchovni schrieb:
> On Sat, Apr 04, 2009 at 06:16:33PM +0200, Robert Schetterer wrote:
> 
>> havening them in hold is a nice option
>> but i am thinking of a script
>> getting them out of hold and store
>> in the filesystem and clean up hold
> 
> Here's my suggestion:
> 
>     - Create a second Postfix instance in the same file-system.
>     - Run a cron job to move (rename(2)) messages from the HOLD queue
>       of the main instance into the deferred queue of the second instance,
>       carefully respecting the hash_depth of each directory.
>     - In the second instance, deliver all mail via a suitable daemonized
>       SMTP server or via pipe(8) script. The daemon or script will be
>       the entry point into a quarantine system that eventualy expires
>       unclaimed mail, generates reports and allows other administrative
>       or user actions as you see fit.
> 
> This means that "FILTER transport:nexthop" is perhaps a better choice than
> "HOLD", but milters may not be able to express this action...
> 
> I am not aware of an open-source quarantine add-on for Postfix.
> 

Hi Victor, this sounds very complicated
i was thinking more about a cron cript like this ( surly modified to the
hold issue )




#!/bin/sh

# we need to clean up MAILER-DAEMON messages

#try to deliver by force
#postqueue -f

#now its time to kill the rest

        TMPFILE=/tmp/clean.queue.$$
        DEFERDIR=/var/spool/postfix/deferred

        # collect the filenames
        mailq |grep MAILER-DAEMON | cut -f1 -d ' ' > $TMPFILE

        for DEFERFILE in `cat $TMPFILE`
        do
           FILEPATH=`find $DEFERDIR -name $DEFERFILE`


#echo "$FILEPATH" #for debug
#echo "$DEFERFILE" #for debug

#############################################################################################################
# checks in use with spamass.
#
#          egrep -i 'spamassassin|hits\=[0-9]{1,2}\.[0-9]' $FILEPATH >
/dev/null
#          if [ $? -eq 0 ]
#          then
#               deferred message is most likely spam
##############################################################################################################
               postsuper -d $DEFERFILE deferred
#          fi
        done

        rm -f $TMPFILE > /dev/null


-- 
Best Regards

MfG Robert Schetterer

Germany/Munich/Bavaria

Reply via email to