procmail
[Top] [All Lists]

Re: global filtering?

1997-01-26 10:16:54
At 10:46 PM 1/25/97 -0500, Lars Kellogg-Stedman wrote:
On Sat, 25 Jan 1997 21:20:35 -0500 (EST) dmuth(_at_)ot(_dot_)com (Doug Muth) 
wrote:

     is there any way to filter ALL incoming e-mail before my the
first of my "usual" procmail recipes?  What I'm looking to do is pipe

I'm not sure I understand the question.  What's wrong with adding
another procmail recipe *before* the others to accomplish this
filtering?  Something like:

# This feeds the message header through grep to remove the content-type 
# header.  The 'f' says that this recipe is a filter, not a delivering
# recipe.

:0fh
| grep -v "^Content-type:"

And then put the rest of your recipes here.

That won't usually work as desired, since:
        1. "Content-type:" can be any combination of lower/upper case
           (fixable by using grep -iv); and
        2. The "content-type:" headerfield may be (and often is)
           continued onto multiple lines.

Let formail do the work:

:0fh
| formail -I Content-Type:

I'm not sure of the wisdom of always removing this header, though.
YMMV.

Cheers,
Stan

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