[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Spam Package help
From: |
Ted Zlatanov |
Subject: |
Re: Spam Package help |
Date: |
Fri, 06 Jul 2007 12:53:11 -0400 |
User-agent: |
Gnus/5.110007 (No Gnus v0.7) Emacs/22.0.96 (darwin) |
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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: Spam Package help,
Ted Zlatanov <=