Skip to main content

Module search

Module search 

Source
Expand description

Searching the mail a server holds and this device does not (docs/client.md, “Searching”).

Sioul keeps recent mail here and brings older mail a round at a time, while the disk has room; folders you left on the server are not kept at all. A search looks here first (sioul_core::mailsearch), then asks the server the same for those folders and days: one connection per account, each folder examined (read-only), UID SEARCH with the search’s keys (RFC 9051 §6.4.4; Gmail’s own X-GM-RAW for attachments, where the server offers it), what is kept here already left out by UID, then the headers, size, flags and parts of the newest (BODY.PEEK[HEADER], BODYSTRUCTURE): the list shows them, and nothing is marked read. A message opened is brought here whole (bring), into its folder, as a sync would have.

Strings that are not ASCII go as literals (RFC 9051 §4.3), with CHARSET UTF-8: non-synchronizing ({n+}, RFC 7888) where the server takes them, else waiting for the server’s go-ahead before each.

Structs§

Outcome
What an account’s server found.

Constants§

BATCH 🔒
Messages fetched per FETCH of headers.

Functions§

bring
Brings a message seen on its server only into its folder here, whole and checked, as a sync would have (unread stays unread: BODY.PEEK). Its file.
bring_in 🔒
command 🔒
A SEARCH command’s pieces: the first sent tagged; each next one after the server’s go-ahead for the literal ending the one before (none with LITERAL+).
here 🔒
The copy here of a message of a folder, if there is one.
kept_root 🔒
Where a folder’s copies are kept here, as a sync keeps them: the inbox in the account’s Maildir itself, any other folder under one name of its own (mailbox::own_dir, which never names the Maildir nor what is above it).
kept_uids
What is kept here of folder: its copies’ UIDVALIDITY and UID.
part_name 🔒
An attachment’s name from its part’s parameters: filename (RFC 2183), else name, encoded words decoded.
parts_of 🔒
A message’s attachments as its BODYSTRUCTURE describes them, their names and types: the parts that have a name, OpenPGP’s own left out (as Card counts them).
quotable 🔒
Whether a string can go quoted (RFC 9051 §4.3: 7-bit, no line break).
quoted 🔒
search
Searches the server of account for search, in folders (their server names as listed), leaving out what is kept here (here: per folder, the UIDVALIDITY and the UIDs of its copies). At most limit come back, the newest first. senders judge who a sender is to you, when a condition asks it.
search_in 🔒
uid_search 🔒
UID SEARCH with literals where needed; the UIDs found.