From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/17659 Path: news.gmane.org!not-for-mail From: Julien Cubizolles Newsgroups: gmane.emacs.gnus.user Subject: Re: Fancy splitting and spam detection Date: Wed, 26 Aug 2015 22:58:31 +0200 Message-ID: <87lhcx3gy0.fsf@free.fr> References: <87vbcal896.fsf@free.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1440675627 6339 80.91.229.3 (27 Aug 2015 11:40:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 27 Aug 2015 11:40:27 +0000 (UTC) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Thu Aug 27 13:40:15 2015 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZUvXQ-0008Km-Kl for gegu-info-gnus-english@m.gmane.org; Thu, 27 Aug 2015 13:40:12 +0200 Original-Received: from localhost ([::1]:37810 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUvXQ-0006hv-2s for gegu-info-gnus-english@m.gmane.org; Thu, 27 Aug 2015 07:40:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37780) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUvXN-0006fJ-8j for info-gnus-english@gnu.org; Thu, 27 Aug 2015 07:40:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUvXK-0001tx-30 for info-gnus-english@gnu.org; Thu, 27 Aug 2015 07:40:09 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:53389) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUvXJ-0001q8-Tf for info-gnus-english@gnu.org; Thu, 27 Aug 2015 07:40:06 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZUvXI-0008Ez-9Z for info-gnus-english@gnu.org; Thu, 27 Aug 2015 13:40:04 +0200 Original-Received: from gas45-3-82-244-252-119.fbx.proxad.net ([82.244.252.119]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 27 Aug 2015 13:40:04 +0200 Original-Received: from j.cubizolles by gas45-3-82-244-252-119.fbx.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 27 Aug 2015 13:40:04 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 116 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: gas45-3-82-244-252-119.fbx.proxad.net User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:NpIvscl62cPm2+vdJkNdNGWiaOo= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.gnus.user:17659 Archived-At: Julien Cubizolles 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.