From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/3421 Path: news.gmane.org!not-for-mail From: Tim McNamara Newsgroups: gmane.emacs.gnus.user Subject: Gnus and SpamAssassin Date: Sat, 24 Jan 2004 20:45:52 -0600 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1138669544 18924 80.91.229.2 (31 Jan 2006 01:05:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 31 Jan 2006 01:05:44 +0000 (UTC) Original-X-From: nobody Tue Jan 17 17:32:11 2006 Original-Path: quimby.gnus.org!newsfeed1.e.nsc.no!nsc.no!nextra.com!news.tele.dk!news.tele.dk!small.news.tele.dk!news-out.visi.com!petbe.visi.com!gemini.bitstream.net.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.gnus User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (darwin) Cancel-Lock: sha1:nqwuIECFT5l7qMHSe0aGtlgS6oI= Original-NNTP-Posting-Host: d7d52cac.news.bitstream.net Original-X-Trace: 1074998752 gemini.bitstream.net 437 216.243.177.155 Original-X-Complaints-To: abuse@bitstream.net Original-Xref: bridgekeeper.physik.uni-ulm.de gnus-emacs-gnus:3562 Original-Lines: 57 X-Gnus-Article-Number: 3562 Tue Jan 17 17:32:11 2006 Xref: news.gmane.org gmane.emacs.gnus.user:3421 Archived-At: I'm trying to integrate Gnus and SpamAssassin for spam management and have been looking around in Info as well as my.gnus.org, where there are two Lisp recipes for combining fancy splitting and SpamAssassin. My knowledge of Lisp isn't quite good enough to compare the two meaningfully; it also seems like one could integrate a BBDB based whitelist into this as well; ISTR there is something in the Gnus and/or BBDB docs. After looking at the two approaches, as well as the Lisp code for reporting spam to sa-learn, here's what's in my .gnus thanks to the generosity of the authors and a bit of cut-and-paste. I'm not sure whether to place the Lisp for using SpamAssassin before or after the usual splits I use to sort out my personal mail, a mailing list I subscribe to, and the rest of it. What I want to do is to split out the mailing list e-mails before processing them through SpamAssassin to save time, since that is never spam; then run the rest of the e-mail through SpamAssassin and sort it into "Personal," "mail.misc" and "spamkill" (where I can examine it before expiring it, and mark it as spam or ham for sa-learn). I'd be grateful if anyone could point out the inevitable egregious errors: (setq nnmail-split-methods 'nnmail-split-fancy) (defun hc:fancy-split-spamassassin () (save-excursion (set-buffer " *nnmail incoming*") (call-process-region (point-min) (point-max) "spamc" t t nil "-f") (goto-char (point-min)) (when (re-search-forward "^x-spam-flag: yes$" nil t) ;; edit the following to the group where spam is to be dropped "spamkill"))) (setq nnmail-split-fancy '(| ("to" "timmcn@bitstream\\.net" "Personal") ("to" "internet-bob@bikelist\\.org" "iBOB") "mail.misc")) (defun report-spam () "Submit Spam." (interactive) (dolist (art gnus-newsgroup-processable) (gnus-summary-goto-article art) (gnus-summary-show-raw-article) (gnus-summary-save-in-pipe "sa-learn --spam") (gnus-summary-delete-article))) (defun report-ham () "Submit Ham." (interactive) (dolist (art gnus-newsgroup-processable) (gnus-summary-goto-article art) (gnus-summary-show-raw-article) (gnus-summary-save-in-pipe "sa-learn --ham")))