# Task 011 — Business Inbox

## Objective

Implement the first iteration of the in-app Business Inbox for operational email workflows.

## Status

Completed.

## Notes

- Task 010 completed outbound SMTP sending and tracking foundations.
- This task should focus on inbox UX and inbox-side workflows only.

## Completed scope

- Added IMAP service (`imap.service.ts`) for verify/connect/fetch/parse.
- Added inbox service (`inbox.service.ts`) for sync, dedupe, linking, list/detail, status update.
- Added inbox APIs: `/api/inbox`, `/api/inbox/[id]`, `/api/inbox/sync`.
- Added IMAP verify API: `/api/email/verify-imap`.
- Added protected UI pages: `/inbox`, `/inbox/[id]`.
- Added linked reply activity logging (`email_replied`).
- Updated env/docs/task indexes for Task 011.

## Acceptance checklist

- [x] `npm run build` succeeds.
- [x] `npm run lint` succeeds.
- [x] `/inbox` exists and is protected.
- [x] `/api/email/verify-imap` implemented.
- [x] `/api/inbox/sync` implemented.
- [x] `EmailReply` records are created with dedupe logic.
- [x] Linking to EmailMessage/Campaign/Company/Person implemented where possible.
- [x] Activities are created for linked replies.
- [x] Inbox list/detail UI and status updates implemented.
- [x] No AI classification logic implemented in this task.
