search: keep every JMAP message for a search of parcel's own

Search asks the server for anything not loaded, and the loaded mail is a few hundred threads. Ranking mail well needs the mail at hand: who wrote it, to whom, when, which list it came by, its files, and its text apart from what it quotes. Keep that for each message in a corpus file in the account's directory, an append-only run of length-prefixed records, mode 0600. A job reads it off the app's thread as the session starts, cuts off a record a crash left short, and times one pass over it, to know whether the engine needs an index. Labels and flags, which change, are left out of it. After each load, the JMAP session walks down every message, newest first: a page of 256 ids, then the ones not kept, 50 to an Email/get with up to 64 KB of each text part, one request at a time. Once a walk has gone all the way down it says so in the file, and later walks end at the first page they already have. List-Id is asked for raw, since Stalwart gives no text form of it.


Author rockorager.dev
Date Commit Parent f3451250
+861 -2
6 changed files
+861 -2
6 changed files