Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Spam setup help
@ 2004-02-25  2:02 Björn Lindström
  2004-02-25 10:45 ` Adrian Lanz
  2004-03-13 17:04 ` Kai Grossjohann
  0 siblings, 2 replies; 4+ messages in thread
From: Björn Lindström @ 2004-02-25  2:02 UTC (permalink / raw)


I've been asking about this before, but never got a satisfying
answer. Now that I've updated to 5.10.6, I thought it would be a good
occasion to try again.

Below is my gnus/bogofilter spam setup.

This does nicely move all spam marked mails into nnfolder:spam and
processes them with bogofilter.

What I miss is the ability to unmark spam in nnfolder:spam, and then,
when I exit the group, get them automatically processed as ham with
bogofilter, and resplitted.

I was hoping that setting gnus-ham-process-destinations would help with
that, but apparently it's not enough.


(setq spam-use-bogofilter t)
(require 'spam)

(setq spam-process-ham-in-spam-groups t

      gnus-spam-process-newsgroups
      '(("^nntp\\+news\\.gmane\\.org:" (gnus-group-spam-exit-processor-report-gmane))
        ("^nnfolder:" (gnus-group-spam-exit-processor-bogofilter
                       gnus-group-ham-exit-processor-bogofilter)))

      spam-report-gmane-use-article-number nil

      gnus-spam-process-destinations '(("nnfolder:.*" "nnfolder:spam"))
      gnus-ham-process-destinations '(("nnfolder:spam" "nnfolder:reclassify"))
      spam-junk-mailgroups '("nnfolder:spam")
      spam-split-group "spam")

-- 
Björn Lindström <bkhl@elektrubadur.se>
http://bkhl.elektrubadur.se/


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

* Re: Spam setup help
  2004-02-25  2:02 Spam setup help Björn Lindström
@ 2004-02-25 10:45 ` Adrian Lanz
  2004-02-29  1:09   ` Björn Lindström
  2004-03-13 17:04 ` Kai Grossjohann
  1 sibling, 1 reply; 4+ messages in thread
From: Adrian Lanz @ 2004-02-25 10:45 UTC (permalink / raw)


On 25 Feb 2004, bkhl@elektrubadur.se wrote:

> I've been asking about this before, but never got a satisfying
> answer. Now that I've updated to 5.10.6, I thought it would be a
> good occasion to try again.
>
> Below is my gnus/bogofilter spam setup.
>
> This does nicely move all spam marked mails into nnfolder:spam and
> processes them with bogofilter.
>
> What I miss is the ability to unmark spam in nnfolder:spam, and
> then, when I exit the group, get them automatically processed as ham
> with bogofilter, and resplitted.
>
> I was hoping that setting gnus-ham-process-destinations would help
> with that, but apparently it's not enough.

Seems the configuration has changed. Try

;; (setq spam-use-stat t) ;; if needed
;; initialize the system
(spam-initialize)

;; prevent multiple registration of articles
(gnus-registry-initialize)
(setq spam-log-to-registry t)

;; declare processsor for splitting incoming mail
(setq spam-use-bogofilter t)

;; where we split incoming spam to
(setq spam-split-group "spam")

;; declare spam and ham groups PROBLEM/QUESTION [1]
(setq spam-junk-mailgroups nil)
(setq gnus-spam-newsgroup-contents
      '(("^nnfolder:spam" gnus-group-spam-classification-spam)
	("^nnfolder:.*" gnus-group-spam-classification-ham)))

;; training spam detection tools
(setq spam-process-ham-in-spam-groups t)
(setq gnus-spam-process-newsgroups
      '(
	("^nntp\\+news\\.gmane\\.org:"
	 ((spam spam-use-gmane)
          (spam spam-use-bogofilter)))
        ("^nnfolder:.*"
	 ((spam spam-use-bogofilter)
	  (ham spam-use-bogofilter)))))

;; moving processed spam
(setq spam-move-spam-nonspam-groups-only t)
(setq spam-mark-only-unseen-as-spam t)
(setq gnus-spam-process-destinations
      '(
        ("^nntp\\+news\\.gmane\\.org:" "nnfolder:spam")
        ("^nnfolder:.*" "nnfolder:spam")))

;; moving processed ham
(setq spam-mark-ham-unread-before-move-from-spam-group t)
(setq gnus-ham-process-destinations
      '(("^nnfolder:spam" "nnfolder:reclassify")))


[1] Ted and others: What is the corret/working solution here. We do
not have a "not matching regexp" syntax in Elisp. How to declare all
groups in nnfolder as ham except the nnfolder:spam group?

a) (setq spam-junk-mailgroups '("nnfolder:spam"))
   (setq gnus-spam-newsgroup-contents
      '(("^nnfolder:.*" gnus-group-spam-classification-ham)))

   But in the code it says, that variable spam-junk-mailgroups is
   depricated.

b) (setq spam-junk-mailgroups nil)
   (setq gnus-spam-newsgroup-contents
      '(("^nnfolder:spam" gnus-group-spam-classification-spam)
	("^nnfolder:.*" gnus-group-spam-classification-ham)))

c) (setq spam-junk-mailgroups nil)
   (setq gnus-spam-newsgroup-contents
      '(("^nnfolder:.*" gnus-group-spam-classification-ham)
        ("^nnfolder:spam" gnus-group-spam-classification-spam)))


   Any difference between b) and c)? Do one of b) and c) do what we
   expect it to do, that is decalre all groups in nnfolder as ham
   except the group nnfolder:spam?


   Similar questions may arise for declarations in
   gnus-spam-process-newsgroups, gnus-ham-process-destinations and
   gnus-spam-process-destinations.

   A nice solution was if we could declare things like:

   (setq spam-junk-mailgroups nil)
   (setq gnus-spam-newsgroup-contents
      '(('(not "^nnfolder:spam") gnus-group-spam-classification-ham)
        ("^nnfolder:spam" gnus-group-spam-classification-spam)))


Thanks, Adrian.


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

* Re: Spam setup help
  2004-02-25 10:45 ` Adrian Lanz
@ 2004-02-29  1:09   ` Björn Lindström
  0 siblings, 0 replies; 4+ messages in thread
From: Björn Lindström @ 2004-02-29  1:09 UTC (permalink / raw)


After reading your mail I end up with the code included in the end of
this post, which seems to work, except for the registration thing. If I
uncomment that, I get this when I try to load gnus:

Loading gnus...
Loading image...done
Loading mule-util...done
Loading gnus...done
Loading gnus-start...
Loading easymenu...done
Loading gnus-start...done
Loading edmacro...done
Loading executable...done
byte-code: Error in ~/.gnus: gnus-registry-initialize

What's that all about?


;;; From ~/.gnus:

;;;
;;; Spam
;;;

(require 'spam)
(spam-initialize)

;; Prevent multiple registration of articles.
; (gnus-registry-initialize)
; (setq spam-log-to-registry t)

;; Processsor for splitting incoming mail
(setq spam-use-bogofilter t)

;; Where to put incoming mail
(setq spam-split-group "spam")

;; Declare spam and ham groups.
(setq spam-junk-mailgroups nil)
(setq gnus-spam-newsgroup-contents
      '(("^nnfolder:spam" gnus-group-spam-classification-spam)
        ("^nnfolder:.*" gnus-group-spam-classification-ham)))

;; Train spam detection tools.
(setq spam-process-ham-in-spam-groups t)
(setq gnus-spam-process-newsgroups
      '(
        ("^nntp\\+news\\.gmane\\.org:"
         ((spam spam-use-gmane)
          (spam spam-use-bogofilter)))
        ("^nnfolder:.*"
         ((spam spam-use-bogofilter)
          (ham spam-use-bogofilter)))))

;; Move processed spam.
(setq spam-move-spam-nonspam-groups-only t)
(setq spam-mark-only-unseen-as-spam t)
(setq gnus-spam-process-destinations 
      '(
        ("^nntp\\+news\\.gmane\\.org:" "nnfolder:spam")
        ("^nnfolder:.*" "nnfolder:spam")))

;; Move processed ham.
(setq spam-mark-ham-unread-before-move-from-spam-group t)
(setq gnus-ham-process-destinations
      '(("^nnfolder:spam" "nnfolder:reclassify")))

-- 
Björn Lindström <bkhl@elektrubadur.se>
http://bkhl.elektrubadur.se/


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

* Re: Spam setup help
  2004-02-25  2:02 Spam setup help Björn Lindström
  2004-02-25 10:45 ` Adrian Lanz
@ 2004-03-13 17:04 ` Kai Grossjohann
  1 sibling, 0 replies; 4+ messages in thread
From: Kai Grossjohann @ 2004-03-13 17:04 UTC (permalink / raw)


bkhl@elektrubadur.se (Björn Lindström) writes:

> What I miss is the ability to unmark spam in nnfolder:spam, and then,
> when I exit the group, get them automatically processed as ham with
> bogofilter, and resplitted.

See variable spam-process-ham-in-spam-groups and perhaps
spam-process-ham-in-nonham-groups.

Kai


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

end of thread, other threads:[~2004-03-13 17:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-25  2:02 Spam setup help Björn Lindström
2004-02-25 10:45 ` Adrian Lanz
2004-02-29  1:09   ` Björn Lindström
2004-03-13 17:04 ` 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).