pub struct MailPaths {
pub notmuch: ResolvedConfig,
pub mbsync: ResolvedConfig,
pub msmtp: ResolvedConfig,
pub notmuch_config: NotmuchConfig,
pub mbsync_config: MbsyncConfig,
pub msmtp_config: MsmtpConfig,
pub maildir_root: PathBuf,
pub database_path: PathBuf,
pub binaries: Binaries,
pub ecr_config_dir: PathBuf,
pub ecr_state_dir: PathBuf,
pub use_index: bool,
}Fields§
§notmuch: ResolvedConfig§mbsync: ResolvedConfig§msmtp: ResolvedConfig§notmuch_config: NotmuchConfig§mbsync_config: MbsyncConfig§msmtp_config: MsmtpConfig§maildir_root: PathBuf§database_path: PathBuf§binaries: Binaries§ecr_config_dir: PathBufWhere ecr keeps its own files, as opposed to the mail tools’ files.
ecr_state_dir: PathBufThe same split XDG draws: state is what ecr rewrites as it runs — the OAuth tokens and the mail index — as opposed to what the user edits.
use_index: boolWhether reads may be answered from the mail index. It is a cache of what notmuch holds, so turning it off costs speed and nothing else; the switch exists so a suspected disagreement can be settled without rebuilding or reinstalling anything.
Implementations§
Source§impl MailPaths
impl MailPaths
pub fn discover() -> Result<Self>
pub fn with(env: &Env, settings: &ServerSettings) -> Result<Self>
Sourcepub fn settings_file(&self) -> PathBuf
pub fn settings_file(&self) -> PathBuf
The user-facing settings file, shared by every client.
Sourcepub fn oauth_profiles(&self) -> Profiles
pub fn oauth_profiles(&self) -> Profiles
The OAuth profiles, anchored to this Env rather than to the process.
Doctor reports on tokens, and reading one adopts it from oauthman’s
directory — so resolving the store from dirs::config_dir() instead of
from here made an integration test against a tempdir read, and write to,
the developer’s real ~/.config/ecr. That is the same trap as
NOTMUCH_CONFIG outranking a redirected HOME: isolation has to come
from the one Env everything else already resolves through.
Sourcepub fn themes_dir(&self) -> PathBuf
pub fn themes_dir(&self) -> PathBuf
Where the shipped presets are seeded and the user’s own themes live.
Sourcepub fn resolve_relative(&self, rel: &str) -> Result<PathBuf>
pub fn resolve_relative(&self, rel: &str) -> Result<PathBuf>
Resolves a path written in settings.toml against ecr’s own directory.
The link is user input that arrives over HTTP, so this is a boundary, not
a convenience: anything that could climb out of ecr_config_dir or name a
file ecr has no business reading is rejected rather than clamped. The
check is lexical because the target need not exist yet — a theme can be
pointed at before it is written.