Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Gnus and SpamAssassin
@ 2004-01-25  2:45 Tim McNamara
       [not found] ` <87y8rv2r88.fsf@uhoreg.ca>
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Tim McNamara @ 2004-01-25  2:45 UTC (permalink / 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")))


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2004-02-15 16:34 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-25  2:45 Gnus and SpamAssassin Tim McNamara
     [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

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