🏠 Go home.

You Should be Using Gnus Adaptive Scoring

Published on

Anyways, the big killer feature for my coworkers has been GMail's 'priority inbox', which learns from your habits and boils "Important" emails to the top of the list using ~ Magic ~. But Magic sucks, and is inscrutable.

Luckily for me, Gnus has a wonderful scoring system that will adapt to what you read and what you expire to generate a dynamic score. Things below the threshold, automated things that you don't care about, bullocks from the press team, all of that gets scored away to the bottom of the folder where you can look at, or allow them to be auto-expired. Things above the threshold will be pushed up to the top of the list where you can read the most important threads to the less important. Give it a couple of weeks and you have a wonderfully trained system that knows mostly what you read and mostly what you ignore.

General usage of Gnus is a topic in and of itself, so I'm not going to touch on general .gnus.el configuration.

First off, actually enable the adaptive scoring; There are two scoring types you can enable, word and line. When applying scores on summary close, word will break each header in to individual words, and add score adaptions for each. line applies a score adaption for the entire line.

(setq gnus-use-adaptive-scoring '(word line))
(setq gnus-adaptive-word-length-limit 5)

Don't add score word's for words that are in the group name; this is useful for groups that mangle subject with [Group] prefixes.

(setq gnus-adaptive-word-no-group-words t)

Gnus uses the group name to write the ADAPT files; this works fine on decent filesystems, but on things like Windows, we have : and [ and ] in the file name and that shit doesn't work one little bit. In fact, OwnCloud will refuse to sync the ADAPT files at all if they have a : in it, which is ridiculous but understandable. So we just replace that all with an underscore.

(setq nnheader-file-name-translation-alist '((?: . ?_) (?[ . ?_) (?] . ?_)) )

The meat of the actual scoring; each item in this alist takes the mark-type from car and the cdr is a list of headers to score, and how to score them. All pretty self explanatory; these are default values, but tweaking these scores is probably a Good Thing to do in the long run.

(setq gnus-default-adaptive-score-alist
      '((gnus-unread-mark)
        (gnus-ticked-mark (from 4))
        (gnus-dormant-mark (from 5))
        (gnus-del-mark (from -4) (subject -1))
        (gnus-read-mark (from 4) (subject 2))
        (gnus-expirable-mark (from -1) (subject -1))
        (gnus-killed-mark (from -1) (subject -3))
        (gnus-kill-file-mark)
        (gnus-ancient-mark)
        (gnus-low-score-mark)
        (gnus-catchup-mark (from -1) (subject -1))))

So far, Gnus has made a much better system for me than GMail; I have my personal mail, and work mail, my RSS feeds and some gmane groups all in one place. The config is portable and thanks to my OwnCloud I have all of my scoring files, the ADAPT files under my control and hardly inscrutable. I'd encourage you to read the documentation on Adaptive Scoring.

Respond to this note:

Ryan Rix is a privacy rights advocate and net-art wannabe. Reach him on the Fediverse as @rrix@cybre.space, twitter as @rrrrrrrix, via email to ryan@whatthefuck.computer or on Facebook or on Matrix as @rrix:whatthefuck.computer.