Email Scanning
Once a mailbox is connected, Campbooks keeps it in sync in the background and processes the messages and attachments it finds.
How scanning works
- Scan — a background job fetches new messages from the provider's API.
- Deduplicate — messages are matched by provider message ID, so a message is never ingested twice.
- Process — each new message is analyzed (triage) and its attachments are downloaded.
- Create documents — every attachment becomes a Document and is queued for AI classification.
Automatic scanning
Scanning runs on a schedule with no setup. A fast incremental sync runs every minute, and a fuller sweep runs every 15 minutes as a safety net.
The incremental sync uses each provider's native delta mechanism rather than re-walking the whole mailbox, so it's quick and light:
| Provider | Incremental strategy |
|---|---|
| Google Workspace | Gmail History API |
| Microsoft 365 | Microsoft Graph delta queries |
| Zoho Mail | Windowed fetch of recent messages |
Manual scanning
You can also trigger a scan yourself: go to Email Scans and start a new scan for a chosen account. Each scan is recorded so you have an audit trail of what ran and when.
Scan status
| Status | Meaning |
|---|---|
| Pending | Scan queued, waiting to run |
| Running | Scan in progress |
| Completed | Scan finished successfully |
| Failed | Scan encountered an error |
What happens to each message
As messages arrive, AI triage categorizes them, assigns a priority, and writes a short summary, so the inbox sorts itself and the things that need you rise to the top. (Triage runs only when an AI provider is configured — otherwise messages still sync, just without the AI signals.)
Attachments go through a processing pipeline:
- Download — files are stored via Active Storage (local disk or S3).
- Create — a Document record is created for each attachment.
- Classify — AI determines the document type and extracts its fields. See Document Classification.
- Index — the document is indexed for search.
Viewing messages
Scanned messages appear in the Inbox and Email Messages views, where you can read the full message and its attachments, reply, tag and organize, move messages between folders, and act on AI-generated suggestions. Workflows can also fire automatically on each incoming message — see Workflows.