From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/83551 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.gnus.general Subject: Re: Imap splitting success Date: Mon, 22 Jul 2013 16:16:43 +0800 Message-ID: <87li4zuhzo.fsf@ericabrahamsen.net> References: <87ppujc7ut.fsf@ericabrahamsen.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1374481113 6520 80.91.229.3 (22 Jul 2013 08:18:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 22 Jul 2013 08:18:33 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M31809@lists.math.uh.edu Mon Jul 22 10:18:34 2013 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V1BKB-0004lR-2Z for ding-account@gmane.org; Mon, 22 Jul 2013 10:18:31 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1V1BIG-0008EE-Nm; Mon, 22 Jul 2013 03:16:32 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1V1BID-0008E3-Jm for ding@lists.math.uh.edu; Mon, 22 Jul 2013 03:16:29 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1V1BIB-00069a-Ou for ding@lists.math.uh.edu; Mon, 22 Jul 2013 03:16:28 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1V1BI9-0001HO-Qt for ding@gnus.org; Mon, 22 Jul 2013 10:16:25 +0200 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1V1BI9-0002ac-Af for ding@gnus.org; Mon, 22 Jul 2013 10:16:25 +0200 Original-Received: from 114.250.130.112 ([114.250.130.112]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 22 Jul 2013 10:16:25 +0200 Original-Received: from eric by 114.250.130.112 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 22 Jul 2013 10:16:25 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 53 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 114.250.130.112 User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:FRoXdar2IKC1gTEuDgf6RhJqzrk= X-Spam-Score: 0.7 (/) X-Spam-Report: SpamAssassin (3.3.1 2010-03-16) analysis follows Bayesian score: 0.0000 Ham tokens: 0.000-2306--14165h-0s--1d--H*u:Emacs, 0.000-723--4437h-0s--1d--H*u:Gnus, 0.000-679--4169h-0s--1d--H*UA:linux, 0.000-679--4168h-0s--1d--H*u:linux, 0.000-669--4104h-0s--1d--H*UA:gnu Spam tokens: 0.989-8838--570h-46218s--0d--HTo:D*gnus.org, 0.989-9217--599h-48222s--0d--HX-Spam-Relays-External:quimby.gnus.org, 0.989-9217--599h-48222s--0d--H*RU:quimby.gnus.org, 0.986-9062--755h-48224s--0d--HX-Spam-Relays-Internal:quimby.gnus.org, 0.986-9062--755h-48224s--0d--H*RT:80.91.231.51 Autolearn status: no 2.9 FSL_HELO_BARE_IP_2 FSL_HELO_BARE_IP_2 1.2 RCVD_NUMERIC_HELO Received: contains an IP address used for HELO -1.5 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [80.91.229.3 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:83551 Archived-At: Eric Abrahamsen writes: > Okay, I've finally got everything working right, and wanted to lay out > my imap splitting setup here for posterity. It was a pain in the butt to > wrap my head around, and I assume other people may have similar > difficulties. It ends up looking pretty simple, though, so maybe I > really am the only one. > > The main headache was BBDB integration. In the normal nnmail setup, BBDB > intercepts all splitting, and calls nnmail-split-fancy if it can't find > its own match. That works because nnmail-split-fancy is both a variable > and a function. > > For nnimap, nnimap-split-fancy is only a variable. Thus the BBDB > integration process is reversed: splitting goes straight to > nnimap-split-fancy, and bbdb/gnus-nnimap-folder-list-from-bbdb dumps > splits directly into it. That took a while to figure out. > > So the basic arrangement: "imap" fields are added to BBDB records you > want to create splits from. to-list/to-address/split-regexp parameters > are added to groups you want to automatically split to. Then: > > (setq gnus-secondary-select-methods > '((nnimap "acc" > (nnimap-inbox "INBOX") > (nnimap-split-methods nnimap-split-fancy)) > > (setq nnimap-split-fancy `(| > ,@(bbdb/gnus-nnimap-folder-list-from-bbdb) > ;; other splits here > (: gnus-group-split-fancy nil t "INBOX"))) > I know everyone already knows this, but another key piece of the puzzle is: (setq nnmail-mail-splitting-decodes t) This ensures that your splits are matched against decoded header values, as you see them in the *Article* buffer, not as they actually exist encoded on file. This is particularly important in the case of gmail, which munges any header with non-ASCII characters. With the above variable set to `t', your splits match against: Subject: Try our new Ultra-腥™ Lutefisk [lʉːtfesk] substitute! Instead of: Subject: Try our new =?utf-8?B?VWx0cmEt6IWl4oSi?= Lutefisk =?utf-8?B?W2w=?= =?utf-8?B?yonLkHRmZXNrXQ==?= substitute! Onward, E