From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/44093 Path: main.gmane.org!not-for-mail From: Daniel Pittman Newsgroups: gmane.emacs.gnus.general Subject: Re: Spam spam spam spam spam Date: Sun, 31 Mar 2002 11:31:35 +1000 Organization: Not today, thank you, Mother. Sender: owner-ding@hpc.uh.edu Message-ID: <87sn6h34lk.fsf@inanna.rimspace.net> References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1017538374 542 127.0.0.1 (31 Mar 2002 01:32:54 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 31 Mar 2002 01:32:54 +0000 (UTC) Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16rUDF-00008d-00 for ; Sun, 31 Mar 2002 03:32:53 +0200 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 16rUCd-0000p5-00; Sat, 30 Mar 2002 19:32:15 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sat, 30 Mar 2002 19:32:21 -0600 (CST) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id TAA22116 for ; Sat, 30 Mar 2002 19:32:09 -0600 (CST) Original-Received: (qmail 22307 invoked by alias); 31 Mar 2002 01:31:57 -0000 Original-Received: (qmail 22302 invoked from network); 31 Mar 2002 01:31:56 -0000 Original-Received: from melancholia.rimspace.net (HELO melancholia.danann.net) (210.23.138.19) by gnus.org with SMTP; 31 Mar 2002 01:31:56 -0000 Original-Received: from localhost (melancholia.rimspace.net [210.23.138.19]) by melancholia.danann.net (Postfix) with ESMTP id E40A12A812 for ; Sun, 31 Mar 2002 11:31:39 +1000 (EST) Original-Received: by localhost (Postfix, from userid 1000) id 1282B8206A; Sun, 31 Mar 2002 11:31:35 +1000 (EST) Original-To: ding@gnus.org In-Reply-To: (Lars Magne Ingebrigtsen's message of "Sat, 30 Mar 2002 16:33:31 +0100") Original-Lines: 138 User-Agent: Gnus/5.090006 (Oort Gnus v0.06) XEmacs/21.5 (bamboo, i686-pc-linux) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:44093 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:44093 --=-=-= On Sat, 30 Mar 2002, Lars Magne Ingebrigtsen wrote: > When I woke up today, I had 75 new mail messages. Out of these, 72 > were spam. And all different. Yay, SPAM. > It's getting pretty annoying. *nod* It did for me. Then I found something to do about it. ;) > Has anybody done any thinking about how to tie Gnus into the various > spam inhibitants that exist? Yup. > I could easily see doing splitting based on ordb/Vipul's > Razor/Spamassassin/etc, SpamAssassin has been the best tool for that sort of thing that I have met so far. It's based on a heuristic system -- assign points for a match in ORBZ, Razor, et al. Given the number of inaccurate reports or deliberate poisonings of ORBZ and Razor, and the occasional response like "oh, yes, it is an incorrect listing. Wait a week and it will expire naturally" from SpamCop... ...having something that treats them as a hint, not an accurate binary yes/no, would be good. > and having single-stroke commands in Gnus for reporting spam to the > proper instances. I have some fairly hackish code that did that for SpamAssassin. > Say, `y' to send the spam for open relay checking, Razoring, > assassination and all the rest. If you want to write this, the following things would be great: * pipe message through a clean-up filter. * send to one or more addresses as a 'bounce' (filtered message as is.) * send to one or more addresses as an rfc822 attachment. * pipe message through one or more reporting filters. * optionally delete the message. * optionally move the message to a different folder (and backend). That way I could meet the various submission requirements around the place. :) Anyway, I had not gotten the round tuits needed to bring the code up to date from when it only did a forward-attached to SpamCop. Here it is. I have signed my papers and everything so feel free to use this as a basis for something more sensible. Daniel --=-=-= Content-Type: application/x-emacs-lisp Content-Disposition: inline Content-Transfer-Encoding: 8bit (defvar spamcop::report-address "quick.XXXXXXXXXXXXXXXX@spam.spamcop.net" "The address that SpamCop reports should be sent to.") (defun spamcop::gnus-file-report () "Forward the selected email to SpamCop to report it and remove it from the current group." (interactive) (let* ((message-forward-as-mime t) (message-forward-show-mml nil) ;; Prevent keyword generation for the message. (message-keyword-interactive nil) (message-keyword-moodwatch nil) ;; Extract information from the article. (article (gnus-summary-article-number)) (header (gnus-summary-article-header article)) (subject (mail-header-subject header)) (from (mail-header-from header))) ;; Are we sure this is right? (if (y-or-n-p (format "\"%s\" from %s is spam? " subject from)) (progn ;; Get gnus ready to forward a message. (gnus-setup-message 'forward ;; Bring up the raw article in the article buffer. (gnus-summary-show-article 'raw) ;; Get message to set up a forward. (let ((mail-parse-charset gnus-newsgroup-charset) (mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets)) (set-buffer gnus-original-article-buffer) (message-forward nil))) ;; Insert the 'to' header. (message-goto-to) (end-of-line) (insert spamcop::report-address) ;; Remove the Gcc field. (message-remove-header "gcc") ;; Send the bugger off. (let ((message-interactive nil)) (message-send-and-exit)) ; ;; Delete the original message. ; (when (gnus-check-backend-function 'request-expire-articles ; gnus-newsgroup-name) ; (let ((not-deleted (gnus-request-expire-articles (list article) ; gnus-newsgroup-name ; 'force))) ; (gnus-summary-remove-process-mark article) ; ;; The backend might not have been able to delete the article ; ;; after all. ; (unless (memq article not-deleted) ; (gnus-summary-mark-article article gnus-canceled-mark)) ; ) ; (gnus-summary-position-point) ; (gnus-set-mode-line 'summary)) ;; Done. (message "Spam complaint sent and article removed.") (gnus-summary-next-unread-subject 1))))) (add-hook 'gnus-summary-mode-hook (lambda () "Add spam complaint key binding." (define-key gnus-summary-mode-map [(control $)] #'spamcop::gnus-file-report))) --=-=-= -- Ask not what you can do for your country, ask what your country did to you. The only reason you're still alive is because someone has decided to let you live. -- KMFDF, _Dogma_ --=-=-=--