procmail
[Top] [All Lists]

Re: condition matching from a file

1997-01-18 13:51:22
On Sat, 18 Jan 1997, Bill Moseley wrote:
At 02:26 PM 1/17/97 -0800, you wrote:
I'm trying to get procmail to something like this:
    * ^From:.*(`cat $PMDIR/file`)

I don't know much unix, but aren't you trying to match the entire file here?
Don't you want to extract the header, then pass it to grep and test the 
result?


Hi Bill, Thanks for thew reply. I have an auto responder that has a
recipe that checks the entire header for a match to a very large list.
The list words are all 'or'ed, so any list word that matches anything
in the header is a 'match'. I don't just check 'From:', but all header
lines for the presence of certain addresses, or domain names, or even
partial domain names. (eg. 'biz').  So at the moment it looks like
this, only with a much bigger list of names: 

:0
* ^.*(\
earthstar|\
moneyworld|\
cyberpromo|\
someuser(_at_)somesite(_dot_)com|\
add-infinitum|\
etc(_at_)etc(_dot_)etc) 
{
( on to a bunch of other things )
}

What I want to do is put the list of names in a file and have the
condition line check for a match to any line in the file. And I would
like to use a file that looks like this, without having to append '|\'
after every line. (That way I can automate the editing of that file
more easily. I could live with appending '|\' if I had to.)

earthstar
moneyworld
cyberpromo
someuser(_at_)somesite(_dot_)com
add-infinitum

I've been looking through Alan's stuff for an examle but haven't found
it. I think the anwer is going to be to use '$' to make the condition
a shell program, but that is all I can figure out so far. I can't make
anything I've thought of work. I think my original question may have
been unclear, so I'm Cc:ing this to the list.

David           "I'm so confused!"