From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: ding@gnus.org
Subject: Re: Displaying stuff from spamassassin headers in the summary buffer?
Date: Sun, 28 Jan 2024 17:22:12 -0800 [thread overview]
Message-ID: <87r0i1kk6z.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87jznt0wy9.fsf@uwo.ca>
Dan Christensen <jdc@uwo.ca> writes:
> 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)
> 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."
> (jdc-gnus-article-sort-by-spam-status
> (gnus-thread-header t1)
> (gnus-thread-header t2)))
>
> But I don't see where I enable these functions.
>
> Dan
These are the remaining puzzle pieces I was too lazy to look up! Thank you.
prev parent reply other threads:[~2024-01-29 1:25 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
2024-01-29 1:22 ` Eric Abrahamsen [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=87r0i1kk6z.fsf@ericabrahamsen.net \
--to=eric@ericabrahamsen.net \
--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).