procmail
[Top] [All Lists]

Conflict between c flag and filter

2002-08-27 06:15:20

        I try to save all the messages in one folder, but, if the message
        is infected by virus, I want to save its header in other file.
        It is not problem to get the header:

:0 fhw
|cat > filename

        The problem start by adding the "c" flag - of course, procmail
        Continue with the body only!   In the following is my recipe
        and again I do not like the solution because I have a feeling
        that I missed something and procmail can do it by setting the
        right flags.

:0 H
* with ESMTP id \/[^    ]+
{
FILE=/var/tmp/Udi/Vdir/$MATCH
HEADER=/var/tmp/Udi/Vdir/$LOGNAME.$MATCH
ANTIVIRUS="/usr/local/sbin/f-prot -dumb -archive -silent"
NOTHING=

        :0 c
        $FILE

        :0 Bw
        * 1^0 $ ! ? $ANTIVIRUS $FILE
        * 0^0 $ NOTHING ?? ? /bin/rm $FILE
        {
                :0 fhwc
                |cat | tee $HEADER
        }
}

:0
/var/tmp/Udi/bigfolder


        Any ideas?

Thanks,
 Udi

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail