Gnus development mailing list
 help / color / mirror / Atom feed
From: Dan Christensen <>
Subject: Re: Displaying stuff from spamassassin headers in the summary buffer?
Date: Sun, 28 Jan 2024 20:06:54 -0500	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Here are some old settings that I'm not using these days, but which
might do things similar to what you want:

(add-to-list 'nnmail-extra-headers 'X-Spam-Status)
(add-to-list 'gnus-extra-headers 'X-Spam-Status)

(defun jdc-spam-status (h)
  "The spam rating from the X-Spam-Status header."
  (string-to-number (gnus-replace-in-string
		     (gnus-extra-header 'X-Spam-Status h)
		     ".*hits=" "")))

(defun gnus-user-format-function-s (h)
  (let ((ss (jdc-spam-status h)))
    (if (> (abs ss) 10)
	(round ss)

With the above settings, I'm able to display the spam score in the
summary buffer line using "%us" in gnus-summary-line-format.  This could
be adapted to display other info.

I also sort my spam group by spam score, so the ones that at most likely
to be mis-classified messages are together:

(defun jdc-gnus-article-sort-by-spam-status (h1 h2)
  "Sort articles by score from the X-Spam-Status: header."
  (< (jdc-spam-status h1) (jdc-spam-status h2)))

(defun jdc-gnus-thread-sort-by-spam-status (t1 t2)
  "Sort threads by score from the X-Spam-Status: header."
   (gnus-thread-header t1)
   (gnus-thread-header t2)))

But I don't see where I enable these functions.


  reply	other threads:[~2024-01-29  1:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-27 23:02 Steinar Bang
2024-01-27 23:29 ` Andreas Schwab
2024-01-28  6:12   ` Steinar Bang
2024-01-28 14:39     ` Eric Abrahamsen
2024-01-28 22:15       ` Steinar Bang
2024-01-29  1:06         ` Dan Christensen [this message]
2024-01-29  1:22           ` Eric Abrahamsen

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* 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).