procmail
[Top] [All Lists]

Re: using sed to snip signatures

1997-06-11 00:13:00
On Tue, 10 Jun 1997 12:46:22 -0700 (MST),
"T.C. Thomas" <misfit(_at_)pobox(_dot_)com> wrote:
On Tue, 10 Jun 1997, Wotan wrote:
Its bad enough that the spammers have found this list.  But do we really
need to see sigs of this size as well?  
Particularly if you can't add the '-- ' so sed can chop the things?
Can you tell me how to do this (chop signature with sed)?

Off top of head:

    :0bf
    | sed -e '/^-- $/q'

This will leave the tearline on the message, and kill everything after
the first tearline. This is probably not good enough for a real-world
application (people leave random tearlines in their messages
sometimes), but it should give you an idea about how to proceed.
  Anyway, the "hard" part is the sed script -- see if you can find a
sed tutorial on the web, or try awk or perl.

    :0bf
    * ^(From|Sender|Reply-to):(.*\<)russ(_at_)otp\(_dot_)illuminet\(_dot_)net\>
    | sed -e '/^[ _]\{40,\}/,$d'
    #               ^^^^^^^ this operator isn't completely standard sed

Hope this helps,

/* 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>

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