procmail
[Top] [All Lists]

Re: Comments?

1997-06-17 13:50:00
W. Wesley Groleau continued,

| I just happened to think that instead of putting
| !^X-Loop: noloop(_at_)noloop\(_dot_)nlp  in every recipe, maybe I should just 
put
| ^X-Loop: noloop(_at_)noloop\(_dot_)nlp in a discard recipe at the beginning.  
Or
| should I do both?

The fewer searches, the better.  If you can, either by getting the case of
the X-Loop:'s presence out of the way or by using a nesting block, egrep for
the X-Loop: only once, that's unquestionably better.  So yes, you're right,
the discard recipe is better than repeating the test.  A nesting block might
be better yet, as mail with the X-Loop: header might fall through the discard
recipe if its action line fails.

| > | * -95^1  ^.*$
| > | * 100^1  money|success|opportunity|wealth
| 
| By the way, I must have missed it in the man page :-) but would this
| recipe work if the only line breaks were between paragraphs?  In other
| words, typed by someone who lets his editor do all the line wrapping?
| So there might be ten lines, but five of them are blank, and the other
| five are each _really_ long and have the flag words several times
| _per_line_.  I suspect it would not.  If not, is there a "simple"
| way to do it?

No; procmail will find a newline only where there is one, not where there
would have been one if the spammer, in a farcical irony, actually had some
communication skills.

You could consider a weight (fractional perhaps) for every non-newline
character and another for every blank line.  Or you could give extra
demerits for very long lines: for example,

   50^1 ....................

embarrasses the sender with fifty points for each twenty characters (but
not the trailing fraction) on any line.  But I suppose that you would be
better off with this:

  2.5^1 .

and award 2.5 demerits for every character on every line (except the
newlines).  Be sure to check for tabs first and expand them to spaces
so that big indentations count against the sender as well.

Another option is this:

   :0Bfb # eighty dots
   * 
................................................................................
   | fmt

Afterward, weighting ^.*$ will count the number of lines that there should have
been.

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