From: Ted Zlatanov <tzz@lifelogs.com>
Cc: Peter Russell <peter.russell@qustom.co.uk>,
Ding Mailing List <ding@gnus.org>
Subject: Re: Spam Package help
Date: Fri, 06 Jul 2007 12:53:11 -0400 [thread overview]
Message-ID: <m2wsxd5v9k.fsf@lifelogs.com> (raw)
In-Reply-To: <85veems993.fsf@qustom.co.uk> (Peter Russell's message of "Mon, 21 May 2007 11:31:56 GMT")
The following message is a courtesy copy of an article
that has been posted to gnu.emacs.gnus as well.
On Mon, 21 May 2007 11:31:56 GMT Peter Russell <peter.russell@qustom.co.uk> wrote:
PR> There are two things I'd like to achieve:
PR> 1. Since these addresses have different profiles, I'd like to use
PR> different bogofilter databases for them. However as far as I can
PR> see there is only one global setting for the database file. Is
PR> this possible - if it isn't now, it worth adding?
Hi Peter,
sorry for the late reply. I cc-ed your e-mail address to make sure
you'd get it.
You can put any Lisp code in the (: ) rule, so you could redefine
spam-bogofilter-database-directory temporarily. Something like this
(let ((spam-bogofilter-database-directory "hello"))
(message spam-bogofilter-database-directory))
(message spam-bogofilter-database-directory)
Use C-x C-e after the last parenthesis of these two expressions. The
first one temporarily sets spam-bogofilter-database-directory to
"hello". So, we can do a rule like this:
(: let ((spam-bogofilter-database-directory "your favorite setting"))
(spam-split "INBOX.Support Requests.spam"))
This is untested, but it should work (I am CC-ing the Gnus developer
list in case someone has a better suggestion). You could always write
your own function that wraps spam-split, if you don't like the solution
above.
PR> 2. Since I need to check support request spam (for example) more often
PR> and more carefully than main INBOX spam, I want to set up some
PR> specific spam folders, which are linked to their parent folders. I
PR> have this almost working.
PR> For number 2, the tree and rules should be something like this:
PR> INBOX <- All mail is delivered here
PR> INBOX.spam <- The default place to drop spam.
PR> Checked infrequently
PR> INBOX.Support Requests <- some mail is split here
PR> INBOX.Support Requests.spam <- Spam to the support requests addr. goes
PR> here. Checked often.
PR> INBOX.Lists... <- Spam that would otherwise be split to
PR> other folders should go to INBOX.spam
PR> (I hope the formatting of that comes out OK, message mode seems to
PR> handle indenting text very nicely :-) )
PR> What I currently have in my gnus.el is this:
PR> ;; We want spam checking!
PR> (spam-initialize)
PR> (setq spam-use-bbdb t
PR> spam-use-regex-headers t
PR> spam-use-bogofilter t)
PR> ;; This doesn't work! What I hoped it would do is to say "If a folder
PR> ;; doesn't end in .spam then it's a ham folder, and any spam in it
PR> ;; should be moved to the same folder name, but with .spam appended.
PR> ;; If it does end in .spam, it's a spam folder, and any ham should be
PR> ;; moved to the folder with the same name, but without the .spam. Not
PR> ;; exactly what I describe above, but close enough. As it is, I don't
PR> ;; believe it's doing anything at all. I have no idea how to debug
PR> ;; this.
PR> (setq gnus-parameters
PR> '(("^\\(nnimap\\+mail.qustom.co.uk:INBOX.*\\)$"
PR> (spam-contents . gnus-group-spam-classification-ham)
PR> (spam-process-destination . "\\1.spam")
PR> '(("^\\(nnimap\\+mail.qustom.co.uk:INBOX.*\\)\\.spam$"
PR> (spam-contents . gnus-group-spam-classification-spam)
PR> (ham-process-destination . "\\1")
You can debug the rules with (gnus-parameter-spam-contents "GROUP").
For instance, your rules would probably return
'gnus-group-spam-classification-spam for this call:
(gnus-parameter-spam-contents "nnimap+mail.qustom.co.uk:INBOX.*.spam")
I personally find it easier to a) make a group a spam group when the
name contains the string "spam", and b) use topics and topic/group
parameters to set parameters as needed. Your way should work, but it
seems harder to me :)
Ted
parent reply other threads:[~2007-07-06 16:53 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <85veems993.fsf@qustom.co.uk>]
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=m2wsxd5v9k.fsf@lifelogs.com \
--to=tzz@lifelogs.com \
--cc=ding@gnus.org \
--cc=peter.russell@qustom.co.uk \
/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).