Gnus development mailing list
 help / color / mirror / Atom feed
From: Michael Shields <shields@msrl.com>
Subject: Re: gnus-summary-sort-by-spamicity (bogofilter)
Date: Wed, 08 Oct 2003 05:13:19 +0000	[thread overview]
Message-ID: <87brssb9cg.fsf@mulligatwani.msrl.com> (raw)
In-Reply-To: <v9fzim72ry.fsf@marauder.physik.uni-ulm.de> (Reiner Steib's message of "Wed, 24 Sep 2003 15:08:01 +0200")

In message <v9fzim72ry.fsf@marauder.physik.uni-ulm.de>,
Reiner Steib <4.uce.03.r.s@nurfuerspam.de> wrote:
> I couldn't gather from the existing sort function in `gnus-sum.el' how
> to write a `gnus-summary-sort-by-spamicity' function.  Any hints?

Here is what I use for Spamassassin scores.  It should be easy to
adapt to bogofilter.

I find it is very helpful in sorting the spam-trap folder; this allows
me to see all the most likely false positives at the top.  Because of
this I've even been able to filter more aggressively.

(add-to-list 'nnmail-extra-headers 'X-Spam-Status)
(defun gnus-article-sort-by-spam-status (h1 h2)
  "Sort articles by score from the X-Spam-Status: header."
  (< (string-to-number (gnus-replace-in-string
			(gnus-extra-header 'X-Spam-Status h1)
			".*hits=" ""))
     (string-to-number (gnus-replace-in-string
			(gnus-extra-header 'X-Spam-Status h2)
			".*hits=" ""))))

-- 
Shields.




  parent reply	other threads:[~2003-10-08  5:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-24 13:08 Reiner Steib
2003-09-24 14:45 ` Ted Zlatanov
2003-10-08  5:13 ` Michael Shields [this message]
2003-11-30 15:27   ` Adam Sjøgren
2003-12-02 11:30     ` Yair Friedman
2003-12-02 15:34       ` Adam Sjøgren

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=87brssb9cg.fsf@mulligatwani.msrl.com \
    --to=shields@msrl.com \
    /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).