procmail
[Top] [All Lists]

recipe help for rejection criteria

1997-05-08 14:59:00
I am trying to put together an include file for an existing includerc to do
some preliminary filtering and I need a little help. What I'd like to do is
call a shell script with different options depending on which criterion
matched and then cease all further processing.

Procmail begins working with the toplevel includerc and then drops into the
user level one (this is for smartlist). I'd like to reject messages based on

1) if it is over a certain size

2) or if it contains a Content-type: (multipart|enriched) match

3) or if it comes from a set of particular addresses

4) or if it has a specific subject

If one of these are triggered I'd like to call the script "reject" with an
option indicating which criterion was matched. "reject" would then mail back
to the sender an indication of the problem and send me a message as well. But
then all further processing should end, i.e. procmail shouldn't go back to
the toplevel instruction file.

As a naive start I coded (don't worry about the generality of the regular
expressions, this is just for discussion purposes):


:0 fhw
* > 10000
| reject -size

:0 fhw
* ^Content-type: (multipart|enriched)
| reject -attach

:0 fhw
^From: (addr1|addr2|addr3)
| reject -notwanted

and so on, but although reject gets called just fine, when it finishes
procmail returns to the instruction file to test the other conditions and,
more importently, returns to the toplevel file when this one is finished.
Setting HOST= doesn't give the desired effect. How can I get processing to
stop completely inside the <reject> script?

Richard
ball(_at_)merck(_dot_)com

-- 
Dr. R.G. Ball                   |  voice: 908-594-5341
Merck Research Laboratories     |  fax: 908-594-6793 or 6100
PO Box 2000, R50-105            |  email: Richard_Ball(_at_)merck(_dot_)com
Rahway, NJ  07065   USA

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