Skip to content

ADR 0008: Provider-Agnostic Mailbox Intake

Context

BooksPlus users often receive accounting evidence by email. BooksPlus needs a way to capture that evidence without making Gmail, Outlook, IMAP, or any other provider the canonical document model.

BooksPlus already treats source evidence as owned by Source Documents. Mailbox intake should feed that ownership model instead of creating provider-specific evidence records.

Decision

BooksPlus should model mailbox intake as a provider-agnostic source-document intake path.

The intake path should normalize incoming mail into a common inbound-message representation before source-document capture and linkage occurs.

The normalized message should preserve:

  • raw message content when available;
  • normalized headers such as from, to, date, and subject;
  • capture source such as forwarded email, uploaded .eml, provider API, or mailbox polling;
  • duplicate-detection keys when available;
  • processing status;
  • target object reference when known.

Rules

  • Mailbox providers are adapters into one common intake flow.
  • Forwarded email and .eml upload are suitable baseline paths.
  • Later provider connectors must map into the same normalized intake representation.
  • Mailbox intake must create or link Source Documents through the Source Documents domain area.
  • Mailbox intake must not create provider-specific source-document tables as canonical evidence truth.
  • When the target object is uncertain, the message should remain reviewable instead of being linked silently.
  • Duplicate detection should be explicit and reviewable.

Initial Status Vocabulary

Useful initial statuses include:

  • received;
  • parsed;
  • linked;
  • duplicate;
  • rejected;
  • needs_review.

Consequences

  • Evidence capture can start with simple user workflows and grow into provider connectors later.
  • Source Documents remains the canonical owner of evidence identity and supersession.
  • Accounting and Close can consume evidence facts without owning mailbox or file-storage behavior.