From ziggy@martigny.ai.mit.edu Thu Apr  9 07:14:56 1998
Received: from biere.ai.mit.edu by martigny.ai.mit.edu with SMTP
	(1.40.112.12/16.2) id AA024650496; Thu, 9 Apr 1998 07:14:56 -0400
Date: Thu, 9 Apr 1998 07:14:56 -0400
From: Michael R. Blair <ziggy@martigny.ai.mit.edu>
Return-Path: <ziggy@martigny.ai.mit.edu>
Message-Id: <199804091114.AA024650496@martigny.ai.mit.edu>
To: kgk@martigny.ai.mit.edu
Subject: Re: M-x spam
Cc: naughty-swiss@martigny.ai.mit.edu
Reply-To: ziggy@martigny.ai.mit.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=X-roman8
Content-Transfer-Encoding: 7bit

|--------------------------------------------------------------------------
| Imagine the following:
| 
| 1. I am reading my email
| 2. I see a piece of spam
| 3. I type M-x spam and:
|    The headers get expanded and parsed, form letters get filled out,
|    mail gets sent, and the spam gets deleted, all in a matter
|    of seconds.
| 
| I'm not sure if there is such an Emacs package out there, but if you
| know of one, please advise me!
|--------------------------------------------------------------------------

Emacs 20 has `uce.el' but I could not find the sources anywhere on the web
(using Alta Vista).  If anyone has this (distributed within Emacs 20 as
file `.../lisp/mail/uce.el') please e-mail me a copy if you can.  Thanks.
The fact that it is distributed with Emacs 20 suggests to me that this may
be the latest greatest thing for dealing with spam (Unsolicited Commercial
E-mail).  It is a bummer I could not find it on the web anywhere (its
author was at the Univ. of Wisc. math department but now that he has moved
back to Russia, his web page is gone and he may as well have moved to
Neptune as far as web access goes).

Nonetheless, you may find the following useful:

	ftp://ftp.swiss.ai.mit.edu/pub/users/ziggy/Hacks/ELisp/Spam/

There you will find:

	--------------
	vm-complain.el	-  Generate complaint to message's sender and ISPs.

	-------------
	gnus-junks.el	-  Do same from inside the `Gnus' news reader.


	----------------------------
	cease-and-desist-notice.text  -  The standard form letter I send.
					 (Based on those of LizB and PZ.)

	-------------
	despam.tar.gz	-  A package for using `procmail' to filter spam
			   and a perl script to send back rejection notices
			   with a magic tag word to use to resend.
	------------
	gnus-spam.el	-  Adding spammers to your `Gnus' kill file.

	--------------
	spam-filter.el	-  Spam filter for `Gnus' based on a hashtable of
			   losing ISPs, addresses, etc. maintained on the
			   web.
	-----------
	procmail.el	-  `procmail'-like BBDB/VM spam filtering.

======
 Note	I have not used any of these packages.  I usually resort to manually
======	generating complaints from my mail reader's reply hook.  If you find
	one of the above packages to useful, please let me know so I can look
	into using it as well.

===============================================================================
From ziggy@martigny.ai.mit.edu Sat Apr 11 11:39:22 EDT 1998
Received: from biere.ai.mit.edu by martigny.ai.mit.edu with SMTP
	(1.40.112.12/16.2) id AA016689159; Sat, 11 Apr 1998 11:39:19 -0400
From: Michael R. Blair <ziggy@martigny.ai.mit.edu>
Return-Path: <ziggy@martigny.ai.mit.edu>
Message-Id: <199804111539.AA016689159@martigny.ai.mit.edu>
Received: by biere.ai.mit.edu
	(1.40.112.12/16.2) id AA048279158; Sat, 11 Apr 1998 11:39:18 -0400
Date: Sat, 11 Apr 1998 11:39:18 -0400
To: kgk@martigny.ai.mit.edu
Subject: Re: M-x Spam (_not_ phone line credit card hashing)
Keywords: uce.el
Comments: Kudos to Scott Smith <ssmith@bullseye.mit.edu>
Cc: naughty-swiss@martigny.ai.mit.edu
Reply-To: ziggy@martigny.ai.mit.edu
Status: RO

|--------------------------------------------------------------------------
| Imagine the following:
| 
| 1. I am reading my email
| 2. I see a piece of spam
| 3. I type M-x spam and:
|    The headers get expanded and parsed, form letters get filled out,
|    mail gets sent, and the spam gets deleted, all in a matter
|    of seconds.
| 
| I'm not sure if there is such an Emacs package out there, but if you
| know of one, please advise me!
|
|        ---kgk
|--------------------------------------------------------------------------

Scott Smith was kind enough to forward to me a copy of `uce.el'.  It looks
like exactly what you want.  You will find it at the following URL:

    ftp://ftp.swiss.ai.mit.edu/pub/users/ziggy/Hacks/ELisp/Spam/uce.el

Place it somewhere in your Emacs load path then add something like this to
your emacs init file:

(progn;;    -------------------	------	-----------------------	----------
  ;;	     Function name	 File	 Document string	 Command?
  ;;	    -------------------	------	-----------------------	----------
  (autoload 'uce-reply-to-uce	"uce"	"Send reply to UCE from Rmail"	t)
  (autoload 'uce-insert-ranting	"uce"	"Insert the canonical UCE rail"	t)
  ;;	     ____
  (defalias 'Spam		; So KGK can type `M-x Spam' inside Rmail
	    'uce-reply-to-uce)
  ;;	     ____
  (defalias 'spam		; So KGK can type `M-x spam' inside Rmail
	    'uce-reply-to-uce)	; (uhm... ELisp is case sensitive. Grrr.)

  );;;;; End of `uce' autoload PROGN


It's default UCE rant string is pretty weak but you can crank up the KTA factor
by replacing it with the contents of the file `cease-and-desist-notice.text' in
the FTP directory cited above.

  Enjoy.
    z

P.S. This program assumes you are sitting in an RMAIL-mode buffer looking at
     the UCE message with truncated headers (normal message read mode). I
     don't use RMAIL to read my e-mail, so I use it by saving a UCE message
     (with complete headers) to $HOME/.Delete/UCE, reading the file into an
     Emacs RMAIL-mode buffer by typing `C-u M-x ~/.Delete/UCE', then invoking
     `M-x spam' as usual.

===============================================================================
From ziggy@martigny.ai.mit.edu Tue Apr 14 23:13:47 EDT 1998
Received: from biere.ai.mit.edu by martigny.ai.mit.edu with SMTP
	(1.40.112.12/16.2) id AA028520026; Tue, 14 Apr 1998 23:13:46 -0400
From: Michael R. Blair <ziggy@martigny.ai.mit.edu>
Return-Path: <ziggy@martigny.ai.mit.edu>
Message-Id: <199804150313.AA028520026@martigny.ai.mit.edu>
Subject: Re: M-x Spam (_not_ phone line credit card hashing)
To: kgk@martigny.ai.mit.edu
Date: Tue, 14 Apr 1998 23:13:42 EDT
In-Reply-To: <199804150138.AA006904310@martigny.ai.mit.edu>; from "Kleanthes Koniaris" at Apr 14, 98 9:38 pm
X-Mailer: Elm [revision: 112.2]
Status: RO

>---------------------------------------------------------------------
> I will download uce and give it a shot!  Thanks for all of the help.
>---------------------------------------------------------------------

No sweat.  I've played with it a bit over the last couple days.  Let
me know if you have any trouble with it or any questions.  I had to
make one patch to the copy I'm using but you may not have the same
problem that I did.  (HP-UX sendmail headers may be non-standard, I'm
not sure.)

If you have trouble, I've enclosed my patch (but please don't make
this patch unless/until you try it w/o the patch because I want some
independent evidence of the problem before I issue a bug report).


That said, here's what I had to do to make it work for me:

    ------------------------------------------------------------------
     Original code inside `uce-reply-to-uce':   [Line 211 of `uce.el']
    ------------------------------------------------------------------
    ;; Now find the mail hub that first accepted this message.
    (while (or (looking-at "Received:")
               (looking-at " ")
               (looking-at "\t"))
      (forward-line 1))
    (while (or (looking-at " ")
               (looking-at "\t"))
      (forward-line -1))
    ------------------------------------------------------------------

    ------------------------------------------------------------------
     My patched code:           [New lines marked with `****']
    ------------------------------------------------------------------
    ;; Now find the mail hub that first accepted this message.
    (let        ((moved-flag nil))      ; **** Flag if forward motion.
      (while (or (looking-at "Received:")
                 (looking-at " ")
                 (looking-at "\t"))
        (forward-line  1)               ; **** Close paren down 1 line
        (setq     moved-flag t))        ; **** Moved, so flag it.
      (if         moved-flag            ; **** BACK UP TO FIX OVERSHOT
        (forward-line -1))              ; **** ELSE NEXT FORM = NO-OP!
      (while (or (looking-at " ")
                 (looking-at "\t"))
        (forward-line -1)))             ; **** New close paren for LET
    ------------------------------------------------------------------

 Enjoy,
   z


===============================================================================
Additional patch as of 1998.06.22 08:53 EST5EDT [after Jun 12 sendmail upgrade]

This patch is w.r.t. my copy of `uce.el' which also incorporates the above fix
-------------------------------------------------------------------
RCS file: /home/zu/ziggy/.Emacs/Spam/RCS/uce.el,v
retrieving revision 1.1
diff -w -r1.1 /home/zu/ziggy/.Emacs/Spam/uce.el
482c482
<       (while (or (looking-at "Received:")
---
>       (while (or (looking-at "Received: from ")
496c496
<     (search-forward ": from ")	(setq		  <temp> (point))
---
>     (search-forward "Received: from ")	(setq		  <temp> (point))

===============================================================================
