infrastructure capa

infrastructure-imap

IMAP MailReader backend (list/fetch only — IMAP is structurally read-only, SMTP is the separate send side)

IMAP MailReader backend (list/fetch only — IMAP is structurally read-only, SMTP is the separate send side)

Tierinfrastructure
Roleunclassified (baselined)
Pathcrates/infrastructure/imap
Edition2021
Targetsinfrastructure_imap
Public items0 across 0 modules
Tests23

What it is for

# infrastructure-imap

IMAP backend implementing foundation_mail_message::MailReader only.

IMAP is structurally read-only in this design — sending mail is the separate infrastructure-smtp crate (sprint 3.45 crate 4). ImapReader therefore has no send method at all, not a stubbed/panicking one (AC-capability-boundary, sprint 3.45 doc).

Security (Gate 1.5.6)

IMAP reads attacker-reachable remote content — any message sitting in a real mailbox, from any sender. Every fetch():

config::ImapConfig::max_message_bytes before issuing the full-body fetch (size_guard.rs), so an oversized message is rejected without ever downloading its body/attachments;

bound, in case a server misreports its own size;

config.io_timeout (each subsequent IMAP command), both wall-clock bounds via tokio::time::timeout on real tokio::net::TcpStream I/O — not the blocking std::net::TcpStream + AllowStdIo pattern the wrapped source used, which cannot honor a timeout mid-read since it blocks the executor thread instead of yielding at an await point.

Credentials (config::ImapAuth) are held only in ImapConfig and never logged; error messages built in backend.rs interpolate protocol text (IMAP NO/BAD responses, transport errors), never the password/token themselves.

Trait fit (OQ4-adjacent finding)

See message_id.rs's doc comment for the one real signature-fit issue: MailReader::fetch(&self, id: &str) has no mailbox parameter, but IMAP UIDs are only unique within one mailbox. Resolved entirely on this side (composite opaque id), no change to crate 1's trait needed.

Capabilities

No public items.

How to use it

No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.

Module structure

No public modules: the crate root is its whole surface.

Public surface

No public items.

Re-exports. Exported here, defined elsewhere.

ExportDefined in
ImapReaderbackend::ImapReader
rfc822_to_emailparse::rfc822_to_email
{ImapAuth,ImapConfig}config::{ImapAuth,ImapConfig}

Boundary

Reaches into foundation.

Shares tier infrastructure with 82 other crates: infrastructure-acquire, infrastructure-adapters-google-calendar, infrastructure-adapters-google-gmail, infrastructure-adapters-google-places, infrastructure-adapters-google-trends, infrastructure-adapters-shodan, infrastructure-adapters-yelp, infrastructure-agent, … (82 total).

_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._

Where it sits

Tier (ontology)infrastructure
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/infrastructure/imap
Vocabulary in force (lexicon)current

Tier flow. Which tiers this crate's own edges cross.

flowchart LR
  n_infrastructure["infrastructure"] --> n_foundation["foundation"]

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`foundation-mail-message`foundationnoalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
async-imap^0.10runtime-tokionoalways
async-native-tls^0.5runtime-tokionoalways
async-trait^0.1noalways
base64^0.22noalways
chrono^0.4serdenoalways
futures^0.3noalways
mailparse^0.15noalways
thiserror^2noalways
tokio^1full, net, timenoalways
tracing^0.1noalways

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
tokio-test^0.4noalways

Build. None.

Depended on by. 1 workspace crate.

Signal flow — what reaches this crate, and what it reaches.

flowchart LR
  n_tools_mail_manager["tools-mail-manager"] -->|uses| SELF
  SELF["infrastructure-imap"]
  SELF -->|runtime| n_foundation_mail_message["foundation-mail-message"]
  classDef self fill:#1f883d,stroke:#1f883d,color:#fff;
  class SELF self;

Feature flags

No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.

Targets

KindNameSource
libinfrastructure_imap`src/lib.rs`

Error model

No public error type was detected: no public item declares a type named *Error, and no public signature returns one.

Operational characteristics

PropertyEvidence
async public surfacenone detected
async runtimeyes
database accessnone detected
network I/Onone detected
unsafe codenone detected
environment variablesnone detected

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.

1 workspace crate depends on this one: tools-mail-manager.

Verification

KindCount
Unit tests23
Integration tests0
Examples0
Doctests0

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc00
Public modules with a //! block00

Metrics

MetricValue
Rust source files8
Source lines1062
Code lines721
Public API items0
Public modules0
Tests23
Examples0
Cargo features0
Direct runtime dependencies11
Workspace reverse dependencies1
pie showData
    title Rust source composition
    "Code" : 721
    "Blank or comment" : 341

Generation

Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.

Todas las infrastructure · Manual