gnus-summary-sort-by-spamicity (bogofilter) (was: Dealing with
lc at statsbiblioteket.dk
Thu Jan 29 06:42:41 EST 2004
On Wed, 2004-01-28 at 14:13, Reiner Steib wrote:
> [ Resent to bogofilter list. My first attempt didn't get thru because
> I wasn't subscribed to the bogofilter list. Sorry, if you see this
> message twice. ]
> On Wed, Jan 28 2004, Lars Clausen wrote:
> > P.S. Has anyone tried to make Gnus sort mails by bogosity?
> See this thread on Ding (Gnus developer list):
Since those articles just expired from the gmane server, I'll post my
Bogofilter-adapted version here. The nnml+Mail:... group should be
replaced with the group your Bogofilter mail ends in. Please don't ask
me for help on setting this up, I had to fight hard enough to get it to
work myself (hint: string-to-number doesn't like strings like "0.995, ")
'nnmail-extra-headers '(X-Bogosity To
'gnus-extra-headers '(X-Bogosity To
(defun gnus-summary-sort-by-x-bogosity (&optional reverse)
"Sort the summary buffer by bogosity alphabetically.
Argument REVERSE means reverse order."
(gnus-summary-sort 'x-bogosity reverse))
(defun spamicity-to-float (string)
".*spamicity=\\([^,]+\\), .*" "\\1"))
(defun gnus-article-sort-by-x-bogosity (h1 h2)
"Sort articles by score from the X-Bogosity: header."
(let ((num1 (spamicity-to-float (gnus-extra-header 'X-Bogosity h1)))
(num2 (spamicity-to-float (gnus-extra-header 'X-Bogosity h2))))
(< num1 num2)))
More information about the Bogofilter