Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Fancy splitting and spam detection
@ 2015-08-20  7:38 Julien Cubizolles
  2015-08-21 19:15 ` Emanuel Berg
  2015-08-26 20:58 ` Julien Cubizolles
  0 siblings, 2 replies; 5+ messages in thread
From: Julien Cubizolles @ 2015-08-20  7:38 UTC (permalink / raw)
  To: info-gnus-english

I'm trying to setup fancy splitting on an imap server and I can't get
spam-split to work:

Here are what I think are the relevant parts of my .gnus.el

--8<---------------cut here---------------start------------->8---
(setq gnus-ignored-from-addresses (regexp-opt '("j.cubizolles@free.fr" "j.cubizolles@gmail.com")))

(spam-initialize 'spam-use-move)

(setq spam-use-bogofilter t)

(require 'spam)

(setq spam-mark-ham-unread-before-move-from-spam-group t)
(setq spam-mark-only-unseen-as-spam t)

(setq spam-split-group "Junk") ;unqualified group name

(setq nnmail-split-methods 'nnmail-split-fancy)

(setq nnmail-split-fancy
      `(|
	("from" ,gnus-ignored-from-addresses "sent-mail")
	(: (lambda ()
		(car (bbdb/gnus-split-method))))
	("gnus-warning" "duplicat\\(e\\|ion\\) of message" "duplicate")
	;; all the rest
	"General"
	))

(setq nnimap-split-fancy
      `(|
	("from" ,gnus-ignored-from-addresses "sent-mail")
	(: (lambda ()
		(car (bbdb/gnus-split-method))))
	("gnus-warning" "duplicat\\(e\\|ion\\) of message" "duplicate")
	(: spam-split 'spam-use-bogofilter)
	;; all the rest
	"General"
	))

(setq gnus-secondary-select-methods
      '(
	(nnimap "gmail"
                (nnimap-address "imap.gmail.com")
                (nnimap-stream ssl)
		(nnir-search-engine imap)
		(nnimap-split-methods 'nnimap-split-fancy)
		(nnimap-inbox "INBOX"))
	(nnimap "free"
		(nnimap-address "imap.free.fr")
		(nnir-search-engine imap)
		(nnimap-split-methods 'nnimap-split-fancy)
		(nnimap-inbox "INBOX")
		)
	)
)
--8<---------------cut here---------------end--------------->8---

On a given spam mail, in an imap INBOX, gnus-summary-respool-trace says:

--8<---------------cut here---------------start------------->8---
(: (lambda nil (car (bbdb/gnus-split-method))))
(: spam-split (quote spam-use-bogofilter))
"Junk"
--8<---------------cut here---------------end--------------->8---

but

gnus-summary-respool-article moves it to "General", the catchall group.

Any idea why the message isn't move where the trace (or the query for
that matter) says it would ?

Thanks for your help.


_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

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

* Re: Fancy splitting and spam detection
  2015-08-20  7:38 Fancy splitting and spam detection Julien Cubizolles
@ 2015-08-21 19:15 ` Emanuel Berg
  2015-08-24 11:41   ` Julien Cubizolles
  2015-08-26 20:58 ` Julien Cubizolles
  1 sibling, 1 reply; 5+ messages in thread
From: Emanuel Berg @ 2015-08-21 19:15 UTC (permalink / raw)
  To: info-gnus-english

Julien Cubizolles <j.cubizolles@free.fr> writes:

> I'm trying to setup fancy splitting on an imap server
> and I can't get spam-split to work:

In addition to a KILL file, I have this to bring order
to the chaos. The zsh, debian.user stuff is a leftover
from the days when I used mailing lists and then
manually splitted them into "newsgroups" - now I have
Gmane do that for me. But splits to spam based on
subjects and the X-Spam-Flag perhaps still catches
some fish.

(setq nnmail-split-methods
 '(("spam-ooa"     "^X-Spam-Flag: YES\\|^Subject:\\(lists.bofh.it mailing list memberships reminder\\|add-subjects-here\\)")
   ("zsh"          "^\\(Cc\\|\\(Resent-\\)?To\\):.*zsh-\\(announce\\|workers\\|users\\)@zsh\.org.*")
   ("debian.user"  "^\\(Cc\\|\\(Resent-\\)?To\\):.*debian-user@lists\.debian\.org.*")
   ("cc"           "^\\(Newsgroups: gnu.emacs.help\\)\\|\\(Cc\\|\\(Resent-\\)?To\\):.*\\(emacs-devel\\|help-gnu-emacs\\|info-gnus-english\\)@gnu\.org.*")
   ("spam-ooa"     "^\\(Cc\\|\\(Resent-\\)?To\\):.*l4-hackers@os\.inf\.tu-dresden\.de.*")
   ("emacs-w3m"    "^Subject: \\(Re: \\)*\\[emacs-w3m.*")
   ("mail.misc"    "") ))

-- 
underground experts united
http://user.it.uu.se/~embe8573



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

* Re: Fancy splitting and spam detection
  2015-08-21 19:15 ` Emanuel Berg
@ 2015-08-24 11:41   ` Julien Cubizolles
  2015-08-24 19:30     ` Emanuel Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Julien Cubizolles @ 2015-08-24 11:41 UTC (permalink / raw)
  To: info-gnus-english

Emanuel Berg <embe8573@student.uu.se> writes:

> Julien Cubizolles <j.cubizolles@free.fr> writes:
>
>> I'm trying to setup fancy splitting on an imap server
>> and I can't get spam-split to work:
>

> (setq nnmail-split-methods
>  '(("spam-ooa"     "^X-Spam-Flag: YES\\|^Subject:\\(lists.bofh.it mailing list memberships reminder\\|add-subjects-here\\)")
>    ("zsh"          "^\\(Cc\\|\\(Resent-\\)?To\\):.*zsh-\\(announce\\|workers\\|users\\)@zsh\.org.*")
>    ("debian.user"  "^\\(Cc\\|\\(Resent-\\)?To\\):.*debian-user@lists\.debian\.org.*")
>    ("cc"           "^\\(Newsgroups: gnu.emacs.help\\)\\|\\(Cc\\|\\(Resent-\\)?To\\):.*\\(emacs-devel\\|help-gnu-emacs\\|info-gnus-english\\)@gnu\.org.*")
>    ("spam-ooa"     "^\\(Cc\\|\\(Resent-\\)?To\\):.*l4-hackers@os\.inf\.tu-dresden\.de.*")
>    ("emacs-w3m"    "^Subject: \\(Re: \\)*\\[emacs-w3m.*")
>    ("mail.misc"    "") ))

Thanks for this example, but I see that you don't use the spam-split
fancy split, which is the one misbehaving in my setup.

Julien.



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

* Re: Fancy splitting and spam detection
  2015-08-24 11:41   ` Julien Cubizolles
@ 2015-08-24 19:30     ` Emanuel Berg
  0 siblings, 0 replies; 5+ messages in thread
From: Emanuel Berg @ 2015-08-24 19:30 UTC (permalink / raw)
  To: info-gnus-english

Julien Cubizolles <j.cubizolles@free.fr> writes:

> Thanks for this example, but I see that you don't
> use the spam-split fancy split, which is the one
> misbehaving in my setup.

Yeah, I don't use that so I can't help you as there
are so many things that can go wrong, almost the only
things you can trust are those you yourself are using
year in, year out. And sometimes you can't trust even
them which is when I apply severe punishment.

-- 
underground experts united
http://user.it.uu.se/~embe8573



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

* Re: Fancy splitting and spam detection
  2015-08-20  7:38 Fancy splitting and spam detection Julien Cubizolles
  2015-08-21 19:15 ` Emanuel Berg
@ 2015-08-26 20:58 ` Julien Cubizolles
  1 sibling, 0 replies; 5+ messages in thread
From: Julien Cubizolles @ 2015-08-26 20:58 UTC (permalink / raw)
  To: info-gnus-english

Julien Cubizolles <j.cubizolles@free.fr> writes:

> I'm trying to setup fancy splitting on an imap server and I can't get
> spam-split to work:

> (setq gnus-ignored-from-addresses (regexp-opt '("j.cubizolles@free.fr" "j.cubizolles@gmail.com")))
>
> (spam-initialize 'spam-use-move)
>
> (setq spam-use-bogofilter t)
>
> (require 'spam)
>
> (setq spam-mark-ham-unread-before-move-from-spam-group t)
> (setq spam-mark-only-unseen-as-spam t)
>
> (setq spam-split-group "Junk") ;unqualified group name
>
> (setq nnmail-split-methods 'nnmail-split-fancy)
>
> (setq nnmail-split-fancy
>       `(|
> 	("from" ,gnus-ignored-from-addresses "sent-mail")
> 	(: (lambda ()
> 		(car (bbdb/gnus-split-method))))
> 	("gnus-warning" "duplicat\\(e\\|ion\\) of message" "duplicate")
> 	;; all the rest
> 	"General"
> 	))
>
> (setq nnimap-split-fancy
>       `(|
> 	("from" ,gnus-ignored-from-addresses "sent-mail")
> 	(: (lambda ()
> 		(car (bbdb/gnus-split-method))))
> 	("gnus-warning" "duplicat\\(e\\|ion\\) of message" "duplicate")
> 	(: spam-split 'spam-use-bogofilter)
> 	;; all the rest
> 	"General"
> 	))
>
> (setq gnus-secondary-select-methods
>       '(
> 	(nnimap "gmail"
>                 (nnimap-address "imap.gmail.com")
>                 (nnimap-stream ssl)
> 		(nnir-search-engine imap)
> 		(nnimap-split-methods 'nnimap-split-fancy)
> 		(nnimap-inbox "INBOX"))
> 	(nnimap "free"
> 		(nnimap-address "imap.free.fr")
> 		(nnir-search-engine imap)
> 		(nnimap-split-methods 'nnimap-split-fancy)
> 		(nnimap-inbox "INBOX")
> 		)
> 	)
> )

For some reason, the following works, no idea why though. I basically
changed the order in which variables are defined, and use the default
value for nnimap-split-methods, with the fancy splitting set by
nnmail-split-fancy instead of nnimap-split-fancy.

--8<---------------cut here---------------start------------->8---
(setq gnus-ignored-from-addresses (regexp-opt '("j.cubizolles@free.fr" "j.cubizolles@gmail.com")))

(setq bbdb/gnus-split-nomatch-function nil
      bbdb/gnus-split-default-group nil
      bbdb/gnus-split-myaddr-regexp gnus-ignored-from-addresses
      )

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

(setq spam-mark-ham-unread-before-move-from-spam-group t)
(setq spam-mark-only-unseen-as-spam t)

(setq spam-split-group "Junk") ;unqualified group name

(setq gnus-secondary-select-methods
      '(
	(nnimap "gmail"
                (nnimap-address "imap.gmail.com")
                (nnimap-stream ssl)
		(nnir-search-engine imap)
		(nnimap-inbox "INBOX")
		(nnimap-split-methods default)
		)
	(nnimap "free"
		(nnimap-address "imap.free.fr")
		(nnir-search-engine imap)
		(nnimap-inbox "INBOX")
		(nnimap-split-methods default)
		)
	(nntp "news.gwene.org"
	      (nnir-search-engine gmane))
	(nntp "news.gmane.org"
	      (nnir-search-engine gmane))
	)
)

(setq nnmail-split-fancy
      '(|
	;; ("from" ,gnus-ignored-from-addresses "sent-mail")
	(: (lambda ()
		(car (bbdb/gnus-split-method))))
	(: spam-split 'spam-use-bogofilter)
	("gnus-warning" "duplicat\\(e\\|ion\\) of message" "duplicate")
	;; all the rest
	"General"
	))

--8<---------------cut here---------------end--------------->8---

Julien.



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

end of thread, other threads:[~2015-08-26 20:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-20  7:38 Fancy splitting and spam detection Julien Cubizolles
2015-08-21 19:15 ` Emanuel Berg
2015-08-24 11:41   ` Julien Cubizolles
2015-08-24 19:30     ` Emanuel Berg
2015-08-26 20:58 ` Julien Cubizolles

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