Skip to main content

Module labels

Module labels 

Source
Expand description

Spam or ham for each message of the corpus, from what is already there (docs/spam-filter.md, “The labels”): what you said, your mail apps’ keywords, the Junk folders, your own filter’s flags, the other folders.

  • Spam: in a Junk-role folder, whoever put it there (your provider, your own filter’s “Move to spam”, a mail filter’s “spam”, you, another mail app); carrying $Junk (or Thunderbird’s older Junk); flagged by your own filter as probably spam (every device’s log of what it flagged), wherever it is now.
  • Ham: in any other folder kept (the corpus leaves out Trash, Drafts and Sent; of Gmail’s All Mail it keeps what no other folder has, your own messages aside), or carrying $NotJunk (or NonJunk, NotJunk, $NonJunk, other mail apps’ words for it).
  • Left out: flagged by your own filter as maybe spam, until you say: a doubt is no label.
  • Your actions (every device’s label log: junk, not junk, “Spam”, “Not spam”, block) beat everything, the newest one winning: a message you said is not spam is never learned as spam, whatever its folder, its keywords or your filter say of it.
  • One message, one label: copies (the same Message-ID in several folders or accounts) become one; when they disagree, the log beats the keywords, which beat the Junk folder, which beats your filter’s flag, which beats the other folders. Copies that disagree at the same level are left out.

Your filter’s verdicts count as they are until you correct them: you are never asked to confirm one, only to say “Not spam” of one that is wrong. Trained again and again, the growing mail and your corrections outweigh its mistakes.

Structs§

Copy
What training needs of one record to decide its label (read in a first pass, so the corpus is never held in memory whole).
Entry
The label logs are phase 0’s (sioul_core::spam::labels): one reader for their lines. One act, one line.
Labeled
One message to learn from.
Moved
The label logs are phase 0’s (sioul_core::spam::labels): one reader for their lines. One message your own filter moved into its account’s Junk folder (the matrix’s “Move to spam”), from where it was; in the log of what it flagged (Flagged), one it flagged where it is. No word of yours: the Porch lists it among the filter’s catches while it is there, and the training learns from it as the module says, until you say otherwise.
Summary
What deciding the labels found, in numbers only.

Enums§

Evidence
What decided a label, weakest first.
Label
The label logs are phase 0’s (sioul_core::spam::labels): one reader for their lines. What you said a message is.

Constants§

JUNK
The keywords that say junk: $Junk (RFC 5788’s registry), and Junk, Thunderbird’s older word, which other apps read too.
NOT_JUNK
The keywords that say not junk: $NotJunk, Thunderbird’s older NonJunk, and NotJunk and $NonJunk, which other apps write.

Functions§

decide
One label per message, from every copy read and the logs (see the module): log, what you said; moved and flagged, what your own filter moved into a Junk folder and what it flagged where it is.
fnv64 🔒
64-bit FNV-1a.
from_address 🔒
A header block’s From address, lowercase.
message_id 🔒
A header block’s Message-ID, bare, read as the label log reads it (spam::labels), so that your actions find their message.
read_flagged
What your own filter flagged where it is, every device’s log, oldest first.
read_log
Your actions, as every device’s label log keeps them ($XDG_STATE_HOME/sioul/spam/labels/), oldest first.
read_moved
What your own filter moved, every device’s log, oldest first.

Type Aliases§

Flagged
The label logs are phase 0’s (sioul_core::spam::labels): one reader for their lines. One message your own filter flagged where it is (the matrix’s “Flag only”) as it arrived: the same line as a move, in its own log (flagged/). The training learns a probable spam flagged so as spam, and leaves a maybe spam out, until you say.