procmail
[Top] [All Lists]

Re: Matching # of recipients in To:?

1997-08-05 09:55:00
On Tue, 5 Aug 97 11:58 EDT, process(_at_)qz(_dot_)little-neck(_dot_)ny(_dot_)us 
(Eli the Bearded) wrote:
So how about this:
     :0
     * $ `egrep '(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|\
             Apparently(-Resent)?)-To):(.*[^a-zA-Z])?)'| sed \
             's/^[A-Za-z][^:]*:/,/' | tr -cd , | wc -c`^0
     * -5^1
     { action(s) }

There's still the issue of wrapped fields, which you do see in To:
fields every now and then. The formail solution I proposed should work
fine in place of egrep, though. 
  (Yes, I know I didn't flesh out the -xOriginal-Resent-To:
-xOriginal-Resent-Cc: etc etc but should you care very much about
those? For catching spam, I'd just look at To: and Cc: and maybe the
presence of an empty Bcc: since some mailers leave them as a trace
that somebody has been Bcc:ed. Also X-Apparently-To: is a good one to
include, but that's about it, I think.)

/* era */

-- 
Defin-i-t-e-ly. Sep-a-r-a-te. Gram-m-a-r.  <http://www.iki.fi/~era/>
 * Enjoy receiving spam? Register at <http://www.iki.fi/~era/spam.html>