procmail
[Top] [All Lists]

Re: my recipe doesn't work.

1998-03-05 16:12:55

# trash anything coming from smut sites
:0
* ^From.*(sex | Sex | SEX | XXX | xxx).*
* *TO.*(sex | Sex | SEX).*
/dev/null

Remove the spaces in "( | | )":

~> echo "From: freestuff(_at_)dailysex(_dot_)com" |egrep 
'^From.*(sex|Sex|SEX|XXX|xxx).
*'
From: freestuf(_at_)dailysex(_dot_)com
~> echo "From: freestuff(_at_)dailysex(_dot_)com" |egrep '^From.*( sex | 
Sex | SEX | XX
X | xxx).*
'
~>

Of course, removing the spaces will now match on anything (essex.com,
essex.net, sexton.com, etc.)  Maybe do some checking on the body of the
message too?

Chris


And, were he to perfectly match sex in a From line, this would still have
not been filtered because of the next line. Well, if the next line were
correct, it would have failed. As it is, it would most likely have failed
as well. Best to leave sex out of the address checks altogether, and
concentrate on Subject headers and, of course, the body, where sex
belongs.

Procmail conditions are 'and'ed, not 'or'ed.

.* at the end of a pattern is useless (except to consume cycles) unless
preceded by a match operator.

If the second condition was meant to begin '* ^TO', the .* following the
TO should not be there. For the .* at the end, see the preceding point.

-- 
Rik Kabel          Old enough to be an adult              
rik(_at_)netcom(_dot_)com

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