See your Outlook inbox and send through Gmail without switching tabs. Outlook folders and message lists (sender, subject, preview) show in Synalux; opening the full body of an Outlook message is not available yet (Yahoo + custom IMAP next). Gmail connects send-only — compose in Synalux and deliver from your own Gmail address, without granting access to mailbox contents. Connect once via OAuth for folder support, spam filtering, and audited reads on read-capable providers.
Live at synalux.ai/mail.
✉️ Unified Inbox Across Providers
One inbox view lists mail from your connected Outlook account. Messages sent from Synalux open inline; Outlook messages show sender, subject and preview only.
- Connect once — OAuth handshake via the generic Connect-Integration pattern; no per-provider page changes.
- Folder support — inbox, spam, all, plus Outlook provider folders.
- Filter — as you type, the search box narrows the loaded message list by subject, sender and preview text; it does not search the full mailbox.
📤 Send + Reply In-Place
- Compose — plain-text message with optional signature and attachments.
- Reply — sends from your own connected Gmail, as a new message; it is not threaded into the original conversation. If you have not connected Gmail, the message is saved in Synalux but not sent, and the page asks you to connect it.
- Outlook is read-only — Synalux lists Outlook mail but does not send, move or change it (the Outlook consent screen also lists write and send permissions, which Synalux does not use today).
- Attachments — uploaded via the Drive module; storage_path validated against allowlist (no path traversal).
- Body sanitization —
body_htmlis HTML-escaped on render to close stored XSS via crafted incoming mail.
🛡️ Spam Blocker Module
Built-in spam classification with per-workspace block lists.
- Per-workspace block list — admins block sender/domain; immediate effect across the workspace.
- Provider-side spam folder is still respected (the read-capable provider's classifier wins on its own folders).
- Phishing heuristics — flags links pointing to recently-registered domains, mismatched SPF/DKIM, lookalike-domain tactics.
🔌 Connect-Integration Pattern
Adding a new mail provider (e.g. Outlook) is ~30 LOC because all providers go through a generic OAuth + message-provider abstraction.
- Connect cards are auto-rendered from a provider declaration — no per-provider UI page.
- Token storage: OAuth tokens AES-256-GCM encrypted at rest; per-workspace isolation enforced.
- Token refresh is centralized; expiry detected and rotated transparently.
- CLI for ops:
portal/scripts/fetch-messages.mjsto pull mail outside the web flow (e.g. for bulk import).
🔒 HIPAA + Audit
- Every read writes an
oauth_token_access_logrow with operation type (list / read / send / delete) so an auditor can reconstruct who accessed what and when. - Workspace isolation guard —
requireWorkspaceMemberruns on every endpoint; RLS double-locks at the database layer. - Credential encryption — provider tokens never stored in plaintext.
- No PHI in URLs — all sensitive identifiers in POST body / signed cookies; logs scrub query strings.
🏗️ Architecture
GET /api/v1/mail/inbox List threads (folder=inbox|spam|all)
GET /api/v1/mail/thread/:id Full thread with quoted history
POST /api/v1/mail/send Send / reply (validates attachments)
GET /api/v1/mail/ai-inbox Rules-based priority categorization (no LLM)
GET /api/v1/mail/suggest-replies AI-generated reply suggestions
GET /api/v1/mail/settings Per-user mail preferences
| Layer | Tech |
|---|---|
| Frontend | Next.js 15 App Router, server components |
| OAuth | NextAuth + per-provider adapter (Outlook read-only; Gmail send-only) |
| Storage | Postgres (Supabase) with RLS; mail_threads, mail_messages, oauth_tokens, oauth_token_access_log |
| Encryption | AES-256-GCM via lib/oauth-crypto.ts |
| Audit | withAudit({ module: 'mail' }) middleware |
| Provider abstraction | lib/message-providers/ — extend with ~30 LOC for new provider |
💳 Plans
| Free | Standard | Advanced | Enterprise | |
|---|---|---|---|---|
| Connect 1 mail account | ✅ | ✅ | ✅ | ✅ |
| Connect multiple accounts | — | ✅ | ✅ | ✅ |
| Spam blocker | — | ✅ | ✅ | ✅ |
| Mail-to-task automation | — | — | ✅ | ✅ |
| Per-patient mail filing | — | — | ✅ | ✅ |
| Bulk archive / move / label | — | — | ✅ | ✅ |
| Custom IMAP / SMTP | — | — | — | ✅ |
🧰 Setup Guide
A built-in modal walks the admin through:
- Click Connect Gmail (send-only) or Connect Outlook on the
/chator/mailpage. - Approve the provider consent screen. Gmail requests
gmail.send(no read, search, archive, label, or delete access) pluscontacts.readonlyfor recipient autocomplete. Outlook requests mail read, write and send permissions; Synalux uses them only to list your folders and messages. - With Outlook, your folders and message lists load in the unified inbox.
- To compose, send or reply, connect your Gmail: mail goes out from your Gmail address.
For opening Outlook messages, Yahoo and custom IMAP support, watch the Roadmap or contact sales.