Gnus development mailing list
 help / color / mirror / Atom feed
From: asjo@koldfront.dk (Adam Sjøgren)
To: ding@gnus.org
Subject: Re: gnus-summary-sort-by-X-Spam-Status
Date: Wed, 05 Sep 2007 12:43:29 +0200	[thread overview]
Message-ID: <87642p1jfy.fsf@topper.koldfront.dk> (raw)
In-Reply-To: <87fy1ux9oi.fsf@jidanni.org>

On Wed, 05 Sep 2007 08:01:01 +0800, jidanni@jidanni.org wrote:

> Gentlemen, I see there is no gnus-summary-sort-by-my-favorite-header
> capability.

You can define your own sort functions, though.

> I want to sort by "X-Spam-Status: Yes, score=23.3" lines.

I've got this function 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:
 ;; SpamAssasin 3.0.0 changed "hits" to "score":
 (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)
                         ".*score=" ""))
      (string-to-number (gnus-replace-in-string
                         (gnus-extra-header 'X-Spam-Status h2)
                         ".*score=" ""))))

and in the group-parameters for my spam-group, I have added:

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

(I am using nnml for my email, which may or may not be of importance).


Ha, I just realized I stopped using SpamAssassin years ago, so the above
is a waste of time in my setup.


  Best regards,

-- 
 "I hope you're not going to ask me to explain a              Adam Sjøgren
  title."                                                asjo@koldfront.dk




      reply	other threads:[~2007-09-05 10:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-05  0:01 gnus-summary-sort-by-X-Spam-Status jidanni
2007-09-05 10:43 ` Adam Sjøgren [this message]

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=87642p1jfy.fsf@topper.koldfront.dk \
    --to=asjo@koldfront.dk \
    --cc=ding@gnus.org \
    /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).