Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Tim McNamara <timmcn@bitstream.net>
Subject: Gnus and SpamAssassin
Date: Sat, 24 Jan 2004 20:45:52 -0600	[thread overview]
Message-ID: <m23ca4690f.fsf@Stella-Blue.local> (raw)

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")))


             reply	other threads:[~2004-01-25  2:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-25  2:45 Tim McNamara [this message]
     [not found] ` <87y8rv2r88.fsf@uhoreg.ca>
     [not found]   ` <m2y8rukdp9.fsf@Stella-Blue.local>
2004-01-26 15:08     ` Tim McNamara
     [not found]       ` <871xpmbre5.fsf@uhoreg.ca>
     [not found]         ` <m27jzeico5.fsf@Stella-Blue.local>
     [not found]           ` <87oesq9v0i.fsf@uhoreg.ca>
     [not found]             ` <m2wu7e9kj2.fsf@Stella-Blue.local>
2004-01-27 19:48               ` Hubert Chan
     [not found]                 ` <m2r7xlhyvt.fsf@Stella-Blue.local>
2004-01-28  0:50                   ` Tim McNamara
2004-01-28 17:49                     ` Hubert Chan
     [not found]                     ` <4nznc7yeay.fsf@collins.bwh.harvard.edu>
     [not found]                       ` <m2ptd3345h.fsf@Stella-Blue.local>
     [not found]                         ` <m2r7xjjvvo.fsf@Stella-Blue.local>
2004-01-29  5:09                           ` Tim McNamara
2004-01-29  5:53                             ` Tim McNamara
     [not found]                             ` <87vfmv5hsh.fsf@uhoreg.ca>
2004-01-29 17:50                               ` Ted Zlatanov
2004-01-29 17:53                         ` modifying incoming messages (was: Gnus and SpamAssassin) Ted Zlatanov
2004-01-26 16:35     ` Gnus and SpamAssassin Hubert Chan
     [not found] ` <m265f0prci.fsf@Stella-Blue.local>
     [not found]   ` <m2broroeng.fsf@Stella-Blue.local>
     [not found]     ` <4nd695o1ml.fsf@collins.bwh.harvard.edu>
     [not found]       ` <m2znc9kyi5.fsf@Stella-Blue.local>
     [not found]         ` <87oesp89a4.fsf@uhoreg.ca>
     [not found]           ` <m2vfmxhyxo.fsf@Stella-Blue.local>
     [not found]             ` <874quh8069.fsf@uhoreg.ca>
     [not found]               ` <m2ektkq5cz.fsf@Stella-Blue.local>
2004-01-28 20:47                 ` Ted Zlatanov
2004-02-15 16:34 ` Kai Grossjohann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m23ca4690f.fsf@Stella-Blue.local \
    --to=timmcn@bitstream.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).