Gnus development mailing list
 help / color / mirror / Atom feed
From: asjo@koldfront.dk (Adam Sjøgren)
Subject: Re: sorting summary on spamassassin score
Date: Thu, 08 Apr 2004 01:33:22 +0200	[thread overview]
Message-ID: <87k70rgy7x.fsf@virgil.koldfront.dk> (raw)
In-Reply-To: <8765cbboma.fsf@uwo.ca>

On Wed, 07 Apr 2004 14:59:41 -0400, Dan wrote:

> Does anyone have code for sorting the summary buffer based on the
> score given by spamassassin? This score appears in a header, which I
> guess I would add to gnus-extra-headers. If someone has ready made
> code, that'd be great.

From earlier discussion I've got the following: in the
group-parameters for my spam-group, this:

 ((gnus-show-threads nil)
  (gnus-extra-headers
   '(X-Spam-Status To Newsgroups))
  (gnus-article-sort-functions
   '(gnus-article-sort-by-spam-status)))

And this in my ~/.gnus:

 ; Sort by X-Spam-Status:
 ; (by Michael Shields <shields@msrl.com> in <87brssb9cg.fsf@mulligatwani.msrl.com>
 ;; Set gnus-extra-headers instead^WALSO:
 (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=" ""))))

You need to rebuild the overview databases for X-Spam-Status to be
added for existing articles, I seem to remember.


  Best regards,

     Adam

-- 
 "We are relaxed but nervous."                                Adam Sjøgren
                                                         asjo@koldfront.dk




  parent reply	other threads:[~2004-04-07 23:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-07 18:59 Dan Christensen
2004-04-07 19:05 ` Wes Hardaker
2004-04-07 23:33 ` Adam Sjøgren [this message]
2004-04-21 19:22   ` Dan Christensen
2004-04-22 18:30     ` Ted Zlatanov
2004-04-23 13:53       ` Dan Christensen
2004-04-23 14:05         ` Adam Sjøgren
2004-04-27 22:41           ` Ted Zlatanov
2004-04-27 23:05             ` Wes Hardaker
2004-04-27 23:09             ` Michael Shields
2004-05-20 18:45             ` Ted Zlatanov

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=87k70rgy7x.fsf@virgil.koldfront.dk \
    --to=asjo@koldfront.dk \
    /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).