Skip to main content

Email8:Access - Business Requirements & Functionality

Audience: product owners, business analysts, and anyone evaluating what Email8:Access does for the business. For architecture read README.md; for wire-level detail read DESIGN.md.

1. Business Purpose​

Email8:Access is the classic mailbox protocol surface of the Email product line. It delivers:

  • Client reach without webmail - Thunderbird, Apple Mail, Outlook, mobile mail clients, backup tools, and migration pipelines reach the mailboxes over the protocols they already speak: IMAP, POP3, and ManageSieve, plus CalDAV/CardDAV/WebDAV for calendar and contact synchronization.
  • One mailbox, many clients - the same underlying mailbox data is projected consistently across protocols; a message filed by a JMAP client is visible to an IMAP client seconds later.
  • Server-side filtering - users manage their own Sieve scripts from any client, so rules follow the account rather than the device.
  • Zero data at risk at this layer - Access holds no mail data of its own; every byte and metadata row lives in Email8:Store, so adding or replacing protocol frontends never touches storage.

2. Business Scope (What the Service Provides)​

#Capability areaWhat the business gets
1IMAP sessionsFull IMAP4rev2/rev1 reading, flagging, searching, sorting, threading, copying, moving, idling over the user's mailboxes
2POP3 sessionsLightweight download access to the INBOX projection (UIDL, TOP, UID-based delete)
3ManageSieveScript listing, upload, compile-check, activation, deletion, rename - RFC 5804 store for server-side filters
4CalDAVCalendar collection browsing, query reports with time-range filters, event create/update/delete, sync-collection
5CardDAVAddress book browsing, contact queries, card CRUD, sync-collection
6WebDAV filesFile node browsing and content transfer for the account's file space
7Access controlShared-mailbox ACL rights surfaced per protocol (grant/revoke/effective rights via the Store data API)
8Fleet healthHealth endpoint + listener advertisement for the Gate's port passthrough
9Admin consoleRemote admin pages (IMAP, Sieve) rendered in the platform dashboard
10TelemetryService telemetry frames on the platform property

What the service does NOT own (business boundary):

Out of scopeOwned by
Mail data, mailboxes, threads, calendar/contact/file storageEmail8:Store (Access is stateless over its data API)
Port ownership for clients (25/465/587/143/993/...)Email8:Gate (Access binds OS-ephemeral; the Gate fronts it)
User identity, passwords, token issuanceSentin8:Auth (Access only verifies presented credentials)
Authorization decisionsShield policy engine (scope-based, roles resolved live)
Message bytes (blobs)Sentin8:Storage (referenced through Store)
Submission / outgoing mailEmail8:Mta (JMAP EmailSubmission proxies there)
Web UI for mailEmail8:Webmail (over JMAP, not over Access)
Event transport, scheduling, storage infraSentin8:Bus, Sentin8:Cron, Sentin8:Storage (platform)

3. Business Capabilities​

3.1 IMAP mailbox access​

CapabilityBusiness rule
AuthenticateCredentials are platform tokens (XOAUTH2/OAUTHBEARER); a session exists only for a verified account mapped in the store's principal registry
List/select mailboxesClients see the account's folder tree including the six bootstrap special-use folders (INBOX, Trash, Junk, Drafts, Sent, Archive)
Read messagesFETCH covers envelope, body structure, text, binary parts, size, flags, internal date
Modify stateSTORE with keywords/flags (including junk keywords that feed the spam-learning pipeline via Store), EXPUNGE, CLOSE, UNSELECT
OrganizeAPPEND (incl. MULTIAPPEND), COPY, MOVE between mailboxes with per-mailbox UIDs preserved
Find messagesSEARCH, ESEARCH, SORT (RFC 5256), THREAD, SEARCHRES; filtering by flags, dates, addresses, text
Change trackingCONDSTORE/QRESYNC via Store's changelog: incremental sync without re-downloading
Long-pollIDLE holds a session open; a mailbox change ends it per protocol semantics
Session limit30-minute idle timeout per session

3.2 POP3 inbox download​

CapabilityBusiness rule
AuthenticateUSER/PASS with the PASS field carrying the platform token
List/downloadINBOX-only projection; message listing with sizes, TOP retrieval of headers+lines
Delete on quitDELE marks are applied as a batch on QUIT; RSET reverts them
Stable identityUIDL = {uid_validity}{uid} so clients deduplicate downloads
Interop guardsCAPA advertises STLS/UIDL/TOP/USER/PIPELINING/UTF8; APOP is rejected

3.3 Sieve script management​

CapabilityBusiness rule
List scriptsScripts per account with active-script indication
Upload/validatePUTSCRIPT compiles the script server-side; a malformed script is rejected before it can misroute mail
ActivateOne active script per account at a time
MaintainGETSCRIPT, DELETESCRIPT, RENAMESCRIPT, CHECKSCRIPT, HAVESPACE (permissive quota)

3.4 Calendar, contacts, and files (DAV)​

CapabilityBusiness rule
DiscoverOPTIONS advertises DAV class 1/2/3, access-control, calendar-access, addressbook
BrowsePROPFIND (Depth 0/1) multistatus listings; MKCOL/MKCALENDAR create collections
QueryREPORT: calendar-query (time-range), addressbook-query, sync-collection (incremental sync)
EditGET/PUT/DELETE on resources; PROPPATCH-lite property updates
LockLOCK/UNLOCK (class-2) so two clients cannot clobber one resource
ShareACL method reads effective rights

3.5 Security and tenancy​

CapabilityBusiness rule
Token-first authXOAUTH2/OAUTHBEARER; no password path is implemented
Scope gatingEvery protocol action maps to an email8:mail:read/email8:mail:write policy decision (Shield, roles resolved live) - token expiry/revocation takes effect on the next command
Tenant isolationEvery store call is tenant-stamped; account binding is sub→principal and is re-established per credential verification
AuditAuthentication outcomes, protocol mutations and errors land in the service audit journal, pushed to the platform audit API

4. Business Events (Outbound)​

Email8:Access publishes no domain events: it mutates nothing directly - all effects (filing, keyword changes, deletions) happen in Email8:Store, which owns the event stream. Access contributes audit journal rows (drained to the platform audit API) and telemetry frames.

Inbound (consumed): none. The Shield hot-reload consumer rides the service's dedicated -policy workload; there is no provisioning or domain consumer at this layer.

ChannelContent
Audit journal → Sentin8:Sys POST /v1/auditAuth failures, scope refusals, protocol mutations (per AUDJOUR contract)
Telemetry → platform stat property accessSession/protocol counters (hourly frames)

5. Business Rules & Invariants​

  1. Access is stateless with respect to mail data: the only table it owns is its audit journal. Loss or upgrade of Access never endangers mailbox content.
  2. A client action can never exceed the calling token's scopes: read scopes cannot delete, and an expired/revoked token ends access at the next command.
  3. One account is always bound per session: after authentication, every request is scoped to that account's data only - cross-account reads are structurally impossible from the protocol layer.
  4. UID stability: per-mailbox UIDs and UIDVALIDITY survive because UID assignment and changelog entries happen once, in Store - never re-derived per protocol.
  5. Junk-flagging from any protocol feeds the same spam-learning pipeline (keywords set through Store insert training samples).
  6. Sieve scripts are compile-validated before activation; a broken script cannot silently reroute production mail.
  7. The Gate owns the well-known ports; Access listeners bind OS-ephemeral and advertise themselves in the fleet registry, so rotating instances never breaks client connectivity.
  8. Every authenticated mutation is audited; the platform audit record is the business trail of who did what to whose mailbox.

6. Target-User Roles & Use Cases​

PersonaWhat they do with Email8:Access
End user with a desktop/mobile clientSets up Thunderbird/Apple Mail/Outlook over IMAP; reads, files, flags, searches mail
Security-conscious userUses POP3 download to a local archive; deletes on server after download
Power userEdits Sieve rules (vacation, filing, redirects) that run server-side for all clients
Calendar/contact userSyncs calendar events and contacts over CalDAV/CardDAV from phone/desktop clients
Migration operatorCopies mailbox content in/out via IMAP APPEND and UID-based tooling
Email administratorWatches the IMAP/Sieve admin pages in the platform dashboard; manages shared mailbox ACLs
Platform operatorRelies on health + telemetry for fleet supervision

7. KPIs / Success Criteria​

CategoryTarget
Protocol correctnessThunderbird/Apple Mail/Outlook interop without protocol-level workarounds; capability sets complete for the advertised commands
LatencySub-second response for typical LIST/FETCH/SEARCH on normal mailboxes
ConsistencyA JMAP-side change is visible to IMAP clients within one changelog refresh (~seconds)
SecurityZero password storage, zero bearer tokens persisted; 100% of mutations authorized per request
AvailabilityGate-passed ports stay live across Access rolling upgrades (ephemeral binds + registry refresh)
AuditabilityEvery auth failure and mutation appears in the platform audit stream

8. Dependencies & Reliance on Other Services​

Relied onFor
Email8:StoreAll mailbox/message/calendar/contact/sieve data reads and writes (internal data API)
Sentin8:AuthCredential verification (token verify, principal lookup)
Shield (Sentin8:Policy)Per-request authorization decisions
Email8:GateClient-facing well-known ports (IMAP 143/993, POP3 110/995, Sieve 4190)
Sentin8:StorageBlob bytes fetched transitively via Store
Sentin8:SysAudit journal drain
Sentin8:BusPolicy-definition hot reload (workload consumer)
Sentin8:StatTelemetry property + metric ingest

9. Acceptance Criteria​

  1. An IMAP client can complete authenticate → list → select → fetch → store → expunge against real Store data with correct untagged responses.
  2. A POP3 client can download exactly the INBOX projection and delete via UIDL-stable identities.
  3. A Sieve client can round-trip list/put/activate/get/delete scripts.
  4. A CalDAV client can discover calendars, run time-range query reports, and create/update/delete events; a CardDAV client likewise for contacts; sync-collection returns incremental changes.
  5. Protocol access with an expired or out-of-scope token is refused with the mapped error, audited, and never falls back to partial data.
  6. No mail data is stored on Access at any point; a cold Access node serves clients after only listener re-advertisement.
  7. make build, make test, make lint pass; the OpenAPI spec matches the implemented routes (drift test).

10. Open Business Questions​

  • Offline/undocumented IMAP extensions some niche clients expect (e.g. legacy vendor quirks) - extend the capability set as real client demand appears.
  • Per-protocol connection limits as a tenant-visible quota (currently a service-level setting only).

Architecture & Design: email8:access and its underlying concepts were designed by Hamid Jahanzad.