procmail
[Top] [All Lists]

Re: adding 'f' to :0w breaks things? odd!

2000-08-25 12:03:32
Hi Cory, 

All the documentation I've read has said to use 'f' when filtering /
using pipes, but when I do so in the following .rc then things break.

Since this has come up more than once recently, please allow me to add
a little to Matt's response.

What "filter" means in 

       Flags can be any of the following:
       ...
       f    Consider the pipe as a filter.

(procmailrc(5) manpage extract) is filter in the classical unix sense --
i.e., the message goes into a "filter" program and comes out, probably
altered in some way.  It gets recaptured by procmail and goes through
other recipes.  That's what this paragraph from the the manpage:

       Non-delivering recipes are: those that cause the output of
       a program or filter to be captured  back  by  procmail  or
       those that start a nesting block.

means.  Here's an example.

    :0 fbw
    * ^content-transfer-encoding:.*quoted-printable
    | mimencode -u -q

What this recipe does is this:  If the incoming message has a
content-transfer-encoding header that says "quoted-printable", it 

 [1] passes the body only (thus the 'b' flag) into "mimencode -u -q";
 [2] checks that mimencode can accept the entire message body (thus no 
     'i' flag);
 [3] checks mimencode's exitcode - i.e., it has to wait for the
     program to exit (thus the 'w' flag) -- and if it's zero,
 [4] replaces the message body with the output of the "filter program", 
     i.e., mimencode (thus the 'f' flag).

(NOTE: if you actually include this recipe you may want to make the
       action line look like this:    | (mimencode -u -q; echo)
       to ensure there are two newlines in a row at the end of the
       message. )

So although 

 [a] the idea of replacing the header/body/both with the output of a
     "filter" program); and
 [b] the idea of "filtering out the bad mail and only forwarding the
     good stuff to xxx(_at_)yyy" 

both use the world "filter", they refer to, as Matt wrote, completely
different things.

hth
collin
-- 
Neither I nor my employer will accept any liability for any problems
or consequential loss caused by relying on this information.  Sorry.
Collin Park                         Not a statement of my employer.

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

<Prev in Thread] Current Thread [Next in Thread>