Skip to content

calternal_imap::mailboxes

Tag-backed virtual folders for #428 D2/D6. Folder names are display paths; they never become filesystem paths. The authenticated provider must resolve the original written Tag, since display case alone is not a Tag identity.

Source: crates/calternal-imap/src/mailboxes.rs

pub struct Mailbox

A validated virtual folder below Notes, with a canonical Tag suggestion.

Implements: Debug, Clone, PartialEq, Eq

pub fn parse(name: &str) -> Result<Self, &'static str>

Reuse the filesystem’s Unicode name policy without accessing a file. Hidden components and traversal spellings have no virtual folder meaning.

pub fn name(&self) -> &str

Exact display spelling for protocol replies; quote with the IMAP codec.

pub fn tag(&self) -> Option<String>

Suggested canonical Tag for a newly created folder. Existing folders must use the stored written Tag to preserve case and spelling.

Source: crates/calternal-imap/src/mailboxes.rs:14

pub fn folder_for_tag(tag: &str) -> Result<String, &'static str>

One written Tag’s display path. Both listing and move resolution use this transform; display collisions must be refused rather than lowercased into a different existing Tag (#428 D2/D6).

Source: crates/calternal-imap/src/mailboxes.rs:79

pub fn folders_for_note(source: &str) -> Result<Vec<String>, &'static str>

Project all Notes, including Task Notes (#646, DESIGN §40). Task fields stay in Markdown; folders still come only from written Tags. An untagged Note has one top-level copy; a multi-tag Note has one copy in each folder, sorted stably.

Source: crates/calternal-imap/src/mailboxes.rs:65

pub const MAX_MAILBOX_BYTES: usize

Maximum virtual folder depth and bytes, independent of an IMAP literal size.

Source: crates/calternal-imap/src/mailboxes.rs:9

pub const MAX_MAILBOX_DEPTH: usize

No doc comment.

Source: crates/calternal-imap/src/mailboxes.rs:10