procmail
[Top] [All Lists]

Re: Conflict between c flag and filter

2002-08-27 09:54:54
On Tue, 27 Aug 2002, Don Hammond wrote:


On 27 Aug, Udi Mottelo wrote:
|
| [...]
| :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?
|

I don't understand what you mean by procmail continuing "with the body
only".  I'm also not sure what is/isn't happening that you do/don't
want or expect. But I'm sure as can be (famous last words) that you
don't want the "f" filter flag on either of the two examples you give
above. The "f" flag renders them non-delivering, and procmail  continues
to process the message (2 of them with the "c" flag). You also don't
need the cat (UUOC), and I have no clue what you're trying to do with
tee.

        Yes, I see that you did not understand me _BUT_ you have already
        helped me, isn't a magic?  (:-)

        What I wanted is:

        1)  Save all the messages in one folder which named "bigfolder".
        2)  If the message is infected - save the header in a file which
            named  Username.TheMessageID  that's it, not collection in
            one folder.

        Because of the "f" flag (that I dropped thanks to you) the filter
        changed the message header to be null (the output of the filter
        is nothing while cat(1)'s output is redirected to a file)  then
        procmail went to the next recipe and saved the message i.e. only
        the body, into the folder bigfolder.

        The tee(1) duplicates the stdout so that output of cat(1) goto a
        file _AND_ stdout, the header is saved the message is not corrupted.

Thanks,
 Udi

P.S.  What is UUOC?

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