Outlook Account Setup Guide
Critical: MailDesk Uses Microsoft Graph, Not Odoo's Outlook
MailDesk Outlook integration is SEPARATE from Odoo's built-in Outlook integration.
MailDesk uses:
- Microsoft Graph API (direct)
- Custom OAuth flow
- Custom token storage
- Delta sync for efficiency
Odoo's built-in Outlook (NOT used by MailDesk):
- IMAP/SMTP fallback
- Different OAuth scopes
- Different token storage
Important: If you configure "Outlook" in Odoo Settings, that is NOT for MailDesk. MailDesk has its own Outlook account type.
What is Microsoft Graph?
Microsoft Graph is the official API for Microsoft 365 and Outlook.com.
Benefits vs IMAP:
- Delta sync: Only fetches changes (like Gmail History API)
- Reliable: Built for applications, not legacy email clients
- Consistent: Works for Outlook.com and Microsoft 365
MailDesk uses Microsoft Graph for all Outlook accounts.
Prerequisites
Before connecting Outlook to MailDesk:
- ✅ Outlook.com or Microsoft 365 account
- ✅ Administrator must have configured Microsoft Graph OAuth
- ✅ Browser with access to your Microsoft account
Note: Administrator must create Azure App Registration first. See Admin Guide.
Step 1: Create Outlook Account in MailDesk
- Open MailDesk app in Odoo
- Click Settings (gear icon) → Mailbox Accounts
- Click Create
- Fill in:
- Name: Descriptive name (e.g., "Work Outlook", "Personal")
- Email Address: [email protected] or [email protected]
- Click Save
Step 2: Authorize Microsoft Account
- After saving, click Authorize Outlook button
- Browser redirects to Microsoft login page
- If not logged in: Enter your Microsoft credentials
- If logged in: Microsoft shows account picker
What you'll see:
Microsoft Account Permissions Request MailDesk wants to access your Microsoft Account This will allow MailDesk to: ✓ Read your mail ✓ Send mail as you ✓ Access your mailbox even when you're not using MailDesk [Cancel] [Accept]
- Click Accept
- Browser redirects back to MailDesk
- Account status changes to "Connected"
What Permissions MailDesk Requests
Scope: https://graph.microsoft.com/Mail.Read
- Read emails (subject, sender, body, attachments)
- Access folder structure
- Read message properties (unread, importance, etc.)
Scope: offline_access
- Refresh access token without re-login
- Keep connection active long-term
Why these permissions?
- Mail.Read: Required to show your emails in MailDesk
- offline_access: Required to sync automatically (without clicking "Authorize" every hour)
Does MailDesk see my password? No. OAuth means Microsoft handles login. MailDesk only receives an access token.
What Happens After Connection
Immediate: Folder Discovery
MailDesk scans your Outlook folders:
Default Folders:
- Inbox → shown as "Inbox"
- SentItems → shown as "Sent"
- Drafts → shown as "Drafts"
- DeletedItems → shown as "Trash"
- JunkEmail → shown as "Spam" (usually not synced)
Custom Folders:
- Projects → "Projects"
- Archive → "Archive"
Note: Unlike Gmail, Outlook folders are real folders. One message, one folder (no multi-folder like Gmail labels).
Step 1: Bootstrap Sync (Newest Messages First)
Timeline: 5-30 seconds
What happens:
- MailDesk fetches newest 50 messages from Inbox
- Messages appear in MailDesk UI immediately
- Other folders (Sent, Drafts) synced next
Why only 50? Bootstrap prioritizes instant usability. Older messages fetched progressively.
Step 2: Incremental Sync (New Messages)
Timeline: Every 5 minutes (automatic)
What happens:
- MailDesk calls Microsoft Graph Delta API
- Fetches only changes since last sync:
- New emails
- Deleted emails
- Folder moves
- Read/unread flag changes
- Updates MailDesk SSOT
- UI refreshes automatically
Delta API Explained:
- Microsoft Graph tracks changes with a deltaLink URL
- MailDesk stores deltaLink, fetches newer changes only
- Efficient: No need to scan entire mailbox
Step 3: Progressive Backfill (Older Messages)
Timeline: Background, over hours
What happens:
- After bootstrap, MailDesk starts fetching older messages
- Batch size: 200 messages per hour (controlled budget)
- Older messages appear progressively
- Continues until entire mailbox synced
Why slow?
- Prevents overwhelming Microsoft Graph API throttling
- Prioritizes recent emails
- Background: doesn't block UI
Example Timeline:
- 0-30 seconds: Newest 50 messages (Inbox)
- 5 minutes: Sent, Drafts synced
- 1 hour: 200 older messages fetched
- 5 hours: 1000 total messages synced
- 1 day: 5000+ messages synced
Outlook-Specific Behavior
Real Folders (Not Labels)
Important: Outlook folders are traditional IMAP-style folders.
One message, one folder:
- Email in Inbox → only in Inbox
- Move to Archive → no longer in Inbox, now in Archive
Different from Gmail:
- Gmail: One message can have multiple labels (appears in multiple folders)
- Outlook: One message, one folder at a time
User Impact: Moving messages removes from original folder.
Sent Mail Behavior
When you send email via MailDesk:
- Immediately: Message appears in MailDesk Sent folder (local entry)
- Background: Outlook automatically saves to SentItems folder
- Next sync (within 5 minutes): Outlook's copy replaces local entry
Why local entry? Outlook takes 5-30 seconds to save sent mail. Local entry prevents "sent mail disappeared" UX.
Result: Sent mail always visible immediately.
Focused Inbox
Microsoft's Focused Inbox:
- Splits Inbox into "Focused" and "Other"
- Powered by machine learning
MailDesk behavior:
- MailDesk shows combined Inbox (Focused + Other)
- No separate "Focused" vs "Other" folders
- If you need this separation: Use Outlook webmail
Why: Graph API provides unified Inbox view. Focused/Other separation is UI-only in webmail.
Common Issues & Solutions
Issue: "OAuth Not Configured"
Symptoms: "Authorize Outlook" button shows error
Cause: Administrator hasn't configured Microsoft Graph OAuth
Solution: Contact your Odoo administrator. They must:
- Create Azure App Registration
- Configure delegated permissions (Mail.Read, offline_access)
- Add credentials to Odoo
See: Admin Guide
Issue: "Messages Not Appearing Immediately"
Symptoms: Sent email in Outlook webmail, doesn't show in MailDesk
Cause: Sync runs every 5 minutes, not realtime
Solution:
- Wait 1-5 minutes for next sync cycle
- OR click Refresh icon in MailDesk
This is normal Graph API behavior (not a bug).
Issue: "Old Messages Loading Slowly"
Symptoms: Can only see recent emails, older messages missing
Cause: Progressive backfill in progress
Solution:
- Wait: Backfill fetches 200 messages/hour automatically
- Check tomorrow: Most mailboxes fully synced within 24-48 hours
This is intentional design (prevents API throttling).
Issue: "Delta Token Expired"
Symptoms: MailDesk shows "Full folder resync required"
Cause: Microsoft Graph Delta token expires after ~30 days of inactivity
What happens:
- MailDesk detects expired deltaLink
- Automatically resets folder
- Re-bootstraps newest 50 messages
- Progressive backfill restarts
User Impact: Brief delay (30-60 seconds), then normal sync resumes
Prevention: Use MailDesk at least once per month
Issue: "Re-Authorization Required"
Symptoms: "Outlook authentication expired, please re-authorize"
Cause: OAuth token revoked (password changed, admin revoked app, security policy)
Solution:
- Go to Settings → Mailbox Accounts
- Click your Outlook account
- Click Re-Authorize Outlook
- Log in again
Why: OAuth tokens can be revoked for security reasons. This is normal.
Issue: "Throttling Delays"
Symptoms: Sync slower than expected
Cause: Microsoft Graph enforces rate limits:
- 10,000 requests per 10 minutes per user (typical limit)
- Throttling: HTTP 429 with Retry-After header
What MailDesk does:
- Detects HTTP 429
- Exponential backoff (waits before retry)
- Silent: No error shown to user
User Impact: Slight sync delays during heavy usage
This is normal — Microsoft Graph protects servers from overload.
Unread Counts and Consistency
Eventually Consistent Unread Counts
Outlook unread counts in MailDesk are eventually consistent:
- Sync runs every 5 minutes
- Unread count updated at END of sync
- Badge updates via websocket
Scenarios:
- Mark read in Outlook webmail → MailDesk badge updates within 5 minutes
- Mark read in MailDesk → Badge updates immediately (optimistic), confirmed by sync
This is intentional (balance between accuracy and performance).
Testing Your Setup
After connection, verify:
Test 1: Receive Email
- Send email to yourself from another account
- Wait 1-5 minutes (next sync cycle)
- Check MailDesk Inbox → should appear
Test 2: Send Email
- Compose email in MailDesk
- Send
- Check Sent folder → should appear immediately
- Check recipient → should receive
Test 3: Folder Move
- Move message to Archive in MailDesk
- Check Inbox → message gone
- Check Archive → message appears
Performance Expectations
Sync Speed
- New emails: Appear within 1-5 minutes (sync frequency)
- Sent emails: Appear immediately (local-first)
- Folder moves: Reflected within 1-5 minutes
Storage
- Metadata: Stored in Odoo database (~1KB per message)
- Full bodies: Cached for 7 days, re-fetched on demand
- Attachments: Fetched on first open, cached temporarily
API Quota
Microsoft Graph provides generous limits:
- 10,000 requests per 10 minutes per user
- Delta queries consume 1 request each
- Typical usage: 50-200 requests/day per user
Privacy & Security
What Microsoft Knows
- Microsoft knows MailDesk requested access to your mailbox
- Microsoft logs OAuth token grants
- Microsoft can revoke access anytime
What MailDesk Stores
- Access token: Stored encrypted in Odoo database
- Refresh token: Used to renew access automatically
- Delta link: URL for next sync query
- Metadata: Subject, sender, date (in message_index)
- Bodies: Cached temporarily (7-day TTL)
What MailDesk Does NOT Store
- ❌ Your Microsoft password (OAuth handles auth)
- ❌ Permanent email bodies (cached with expiry only)
- ❌ Attachment binaries (fetched on-demand)
Revoking Access
To disconnect MailDesk from Outlook:
- In MailDesk: Delete account → Settings → Mailbox Accounts → Delete
- In Microsoft: Revoke app access
- Go to Microsoft Account Permissions
- Find "MailDesk"
- Click "Remove"
Effect: MailDesk can no longer access your Outlook. Existing cached data remains in Odoo.
MailDesk Outlook vs Odoo Outlook
| Aspect | MailDesk Outlook | Odoo Outlook Integration |
|---|---|---|
| Purpose | Full email client | Send emails from Odoo forms |
| API | Microsoft Graph | IMAP/SMTP or Graph (depends) |
| OAuth Flow | MailDesk custom | Odoo built-in |
| Token Storage | mailbox.account model | Odoo settings |
| Sync | Automatic (every 5 min) | Manual (Odoo sends) |
| Reading Mail | Full inbox support | Not designed for reading |
| Use Case | Daily email management | Odoo CRM/Projects automation |
They are NOT the same. Configuring "Outlook" in Odoo Settings does NOT configure MailDesk Outlook.
Outlook.com vs Microsoft 365
Both work with MailDesk:
Outlook.com (personal):
- Free Microsoft email (@outlook.com, @hotmail.com)
- OAuth tenant: common
- Works without organization admin
Microsoft 365 (business):
- Company email (@your-company.com via Microsoft 365)
- OAuth tenant: Your organization's tenant ID OR common
- May require admin consent (Enterprise Application)
MailDesk supports both — same setup process.
Next Steps
✅ Account connected → Read Daily Usage Guide to learn features (to be created)
✅ Need multiple accounts → Repeat setup for each Outlook account
✅ Having issues → See FAQ & Troubleshooting (to be created)
✅ Administrator setup → See Outlook Graph OAuth Setup Admin Guide