From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/57509 Path: main.gmane.org!not-for-mail From: "Ted Zlatanov" Newsgroups: gmane.emacs.gnus.general Subject: Re: Spam splitting and multiple nnimap methods Date: 18 May 2004 15:11:49 -0400 Organization: =?koi8-r?q?=F4=C5=CF=C4=CF=D2=20=FA=CC=C1=D4=C1=CE=CF=D7?= @ Cienfuegos Sender: ding-owner@lists.math.uh.edu Message-ID: <4nr7thble2.fsf@lifelogs.com> References: <20040517175042.B23864@gwyn.tux.org> <20040518085316.A4024@gwyn.tux.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1084908535 310 80.91.224.253 (18 May 2004 19:28:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 18 May 2004 19:28:55 +0000 (UTC) Cc: "Jonas Steverud" , ding@gnus.org Original-X-From: ding-owner+M6049@lists.math.uh.edu Tue May 18 21:28:42 2004 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BQAGX-00014X-00 for ; Tue, 18 May 2004 21:28:41 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1BQAGF-0005Wx-00; Tue, 18 May 2004 14:28:23 -0500 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1BQAGA-0005Ws-00 for ding@lists.math.uh.edu; Tue, 18 May 2004 14:28:18 -0500 Original-Received: from justine.libertine.org ([66.139.78.221] ident=postfix) by util2.math.uh.edu with esmtp (Exim 4.30) id 1BQAG9-0002fu-IS for ding@lists.math.uh.edu; Tue, 18 May 2004 14:28:17 -0500 Original-Received: from mail.bwh.harvard.edu (sysblade0.bwh.harvard.edu [134.174.9.44]) by justine.libertine.org (Postfix) with ESMTP id C655C3A021E for ; Tue, 18 May 2004 14:28:16 -0500 (CDT) Original-Received: (qmail 6683 invoked from network); 18 May 2004 19:22:44 -0000 Envelope-Sender: tzz@lifelogs.com Envelope-Recipients: tim@tux.org, tvrud@bredband.net, ding@gnus.org, Original-Received: from asimov.bwh.harvard.edu (HELO asimov) ([134.174.9.63]) (envelope-sender ) by mail.bwh.harvard.edu (qmail-ldap-1.03) with SMTP for ; 18 May 2004 19:22:42 -0000 Mail-Followup-To: "Timothy Brown" , "Jonas Steverud " , ding@gnus.org Original-To: "Timothy Brown" X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6;d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" In-Reply-To: <20040518085316.A4024@gwyn.tux.org> (Timothy Brown's message of "Tue, 18 May 2004 08:53:16 -0400") User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux) Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:57509 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:57509 On Tue, 18 May 2004, tim@tux.org wrote: > Where can I make a server declaration? If I have something like: > >> spam-split-group "Spam" > > Does that split to the spam group locally (nnfolder), does it split to > the IMAP group on that particular server, or does it split to an IMAP > group on a different server? spam-split-group is returned by spam-split, that's all. So if a valid group name can be a split target, it's valid for spam-split-group. This means that it really depends on the server, but generally the group will be created as an IMAP folder on an nnimap server, or as a directory on a nnml server for example. I actually meant to write cross-server splitting, which would allow "nnimap+server.com:externalgroup" but I keep forgetting about it. No one seems to be clamoring for it, so I guess it's not that important. > And when is split-group looked at? When you invoke spam-split. > Many times my messages will say they are being "IMAP split > host:INBOX:xx to INBOX" but Gnus never sees them as part of that > mailbox. They aren't being lost, exactly, but they do exist. I have no idea what you mean here, sorry. > Also, how does splitting on nnimap, and spam-split, interact? So > far i've had terrible luck with imap splitting, even with > splitting on the bodies as the manual says. spam-split is just a function that can return nil (meaning "skip this rule") or a string (meaning a group name). It should not be last because it could return nil and then you make Gnus unhappy. > This is one area where Gnus' flexibility is giving me a huge > headache - the manual just isn't clear enough. This is my fault, since I wrote most of the spam support documentation. I've had help from several volunteers with the manual; if you would like to help as well that would be great. >> I've added (: spam-split) to my split rules. > > My own split rules are pretty simple - essentially split from "INBOX" > (which nnimap box is it splitting from? From all of them?), run > : spam-split, (see question above), and then return messages not split > to "INBOX" (again, is this on the server i'm currently checking)? You should not split back into INBOX. It's been done, but it's unnecessary. Make your last split group "mail" for example and you'll be happier. Each IMAP server with a nnimap server entry in your Gnus setup can have its own split rules. This is my setup, for instance: (setq nnimap-split-rule '( ("lifelogs" ("INBOX" nnimap-split-fancy)) ("imap" ("INBOX" nnimap-courier-split-fancy)))) as opposed to the simpler but less useful: (setq nnimap-split-rule 'nnimap-split-fancy) I use nnimap-courier-split-fancy as a wrapper around nnimap-split-fancy to prepend "INBOX." to the group names, because of Courier IMAP's particular group name prefix, but that's not important. What's important is that you can specify split rules for each server, instead of one rule for them all. >> Now comes the second part; tell spam.el which groups contains spam and >> which don't. That is done with group parameters. > > This part i'm sort of kind of -- well, totally lost on. I'll write out some text here that may go in the manual, so forgive me if I get a little too wordy. You can see some information at http://lifelogs.com/spam, where I try to explain the top-level ideas about spam.el. There's only three important things in the group parameters. 1) the group spam/ham classification, 2) the exit spam/ham processors, and 3) the exit spam/ham destination. All of them, and the rest, can be accessed with `G c'. The exit spam/ham processors are applied to spam or ham mail when you exit the group. The exit spam/ham destination is where spam or ham is moved when you exit the group (nil, the default, means expire; 'respool means to respool it back the splitting process). You can even specify multiple group names here, and they can be on other servers! The group classification is important when you enter AND exit a group. When you enter a SPAM group, any UNREAD messages will be marked as spam. When you enter any other type of group (ham or unclassified), you have to mark spam manually. Ham is mail that matches the ham-marks parameters. Things get complicated here, but basically you can control that parameter to only consider ticked (!) articles ham, for instance. The defaults should be OK for most users. Spam is also identified through a parameter (spam-marks) but you should really leave that to be just the spam article mark. Some people consider low-score articles spam, but I don't recommend it. Finally, the group classification (ham/spam) matters when you exit the group. Ham, for instance, will get moved out of spam groups but not out of ham groups. > My assumption is: > > - INBOX will always contain spam. > - I don't care about any other groups at the moment. > - If there is spam in INBOX, move it elsewhere; > - when I leave INBOX, process what I have marked (with S x) as > spam for bogofilter to train with. You don't say where spam that bogofilter detects should go. I'll assume it will go to "spam" - set the spam-split-group variable to that. I suggest you make "mail" you main mailbox, and leave INBOX to be just the splitting source. Set spam-use-bogofilter to t globally. Use spam-split in your IMAP splitting methods, and it will send what bogofilter thinks is spam to the spam-split-group ("spam"). Make "mail" the last entry in your splitting method, so all mail will go there. Make "mail" a spam group, and when you enter it all unread mail will be marked as spam. Set the "mail" group spam exit processor to bogofilter. Do the same as above for the "spam" group. Now all spam mail will be processed and marked as expired (since there is no spam destination for the "mail" and "spam" groups). You can delete it when you want, or let automatic expiry do it for you. If it seems like "spam" and "mail" are similar, you're right. Most people make "mail" a ham group, and "spam" a spam group. But you can do it your way if you like. > The questions: > > - Do I need to do anything with ham? > - If so, what? Well, if you want to train bogofilter with the ham, for every spam group you have, set the ham exit processor to bogofilter, and the ham destination to a group you want to hold your ham messages. > - How do I achieve the right functionality with the rules above? Let me know if the information above is what you wanted, first, before we write the code. Ted