Gnus development mailing list
 help / color / mirror / Atom feed
From: "Ted Zlatanov" <tzz@lifelogs.com>
Cc: "Jonas Steverud" <tvrud@bredband.net>, ding@gnus.org
Subject: Re: Spam splitting and multiple nnimap methods
Date: 18 May 2004 15:11:49 -0400	[thread overview]
Message-ID: <4nr7thble2.fsf@lifelogs.com> (raw)
In-Reply-To: <20040518085316.A4024@gwyn.tux.org> (Timothy Brown's message of "Tue, 18 May 2004 08:53:16 -0400")

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



  parent reply	other threads:[~2004-05-18 19:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-17 21:50 Timothy Brown
2004-05-18  9:53 ` Jonas Steverud
2004-05-18 12:53   ` Timothy Brown
2004-05-18 13:50     ` Jonas Steverud
2004-05-18 14:02     ` IMAP Splitting with multiple mailboxes (was Re: Spam splitting and multiple nnimap methods) Timothy Brown
2004-05-18 14:13       ` IMAP Splitting with multiple mailboxes Kai Grossjohann
2004-05-18 14:15         ` Timothy Brown
2004-05-18 15:53           ` Kai Grossjohann
2004-05-18 15:58             ` Timothy Brown
2004-05-18 16:14               ` Kai Grossjohann
2004-05-18 14:13     ` Spam splitting and multiple nnimap methods Jonas Steverud
2004-05-18 19:11     ` Ted Zlatanov [this message]
2004-05-18 22:19       ` Timothy Brown
2004-05-19 11:36         ` Jonas Steverud
2004-05-19 14:50           ` Ted Zlatanov
2004-05-19 14:48         ` Ted Zlatanov
2004-05-20 10:27       ` Yair Friedman
2004-05-20 18:49         ` Ted Zlatanov
2004-05-22 23:45           ` Lars Magne Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4nr7thble2.fsf@lifelogs.com \
    --to=tzz@lifelogs.com \
    --cc=ding@gnus.org \
    --cc=tvrud@bredband.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).