Complete Microsoft 365 email integration for Odoo - send and receive with full control.
Outgoing Email:
- Send From dropdown in email composer
- Personal, shared, and notification mailbox support
- Auto-create personal mailbox on Microsoft connect
- Default mailbox per user
Incoming Email:
- Automatic sync from Microsoft 365 mailboxes (1 min interval)
- 2-way sync: Inbox and Sent Items
- Reply threading via In-Reply-To headers + Microsoft conversationId fallback
- Historical email sync with configurable start date
- Known partners filter: only sync emails from existing contacts
- "All" sync mode with per-contact routing rules
- Per-contact block list to exclude specific senders
- New emails create CRM Leads with activity for mailbox owner
Security:
- OAuth 2.0 with delegated permissions only (least privilege)
- Token encryption at rest
- In Odoo.sh, go to Settings → Submodules
- Click Add submodule
- Enter:
git@github.com:pantalytics/pan_outlook_pro.git - Copy the Public Key and add it as Deploy Key in GitHub
# Local: add submodule
git submodule add git@github.com:pantalytics/pan_outlook_pro.git addons/pan_outlook_pro
git commit -m "Add pan_outlook_pro submodule"
git pushAfter installing the module, go to Settings → scroll to Outlook Pro.
The settings page contains step-by-step instructions for:
- Creating an Azure App Registration
- Configuring API permissions and granting admin consent
- Connecting your Microsoft account
- Setting up mailboxes
Follow the instructions in Odoo - they include links to the correct Azure Portal pages and explain each step.
- Go to My Profile → Preferences → Email tab
- Click Connect Microsoft Account
- Sign in and grant permissions
- A personal mailbox is automatically created
- In My Profile → Preferences → Email tab
- Select your default Send From mailbox
- Save
Note: If your Microsoft account is not connected or no default mailbox is set, you'll see a warning banner when opening the email composer.
Go to Settings → Outlook Pro → Manage Mailbox List
| Type | Description |
|---|---|
| Personal | User's own mailbox. Auto-created on connect. Only visible to owner. |
| Shared | Team mailbox (sales@, support@). Visible to all users. Each user sends with own OAuth. |
| Notification | System emails. One designated sender user. |
Prerequisite: Create a Notification mailbox first (required for handling emails from external authors).
- Open a mailbox
- Select Sync Mode:
- Send messages only - Outgoing only (no sync)
- Send and receive messages from existing contacts - 2-way sync, only from known partners
- All - 2-way sync with configurable routing rules per contact type
- Configure Routing:
- Select a Team (alias) to route emails to (e.g., Helpdesk, Sales)
- Emails create tickets/leads in the selected team
- Set the Owner (must have Microsoft connected)
- Optionally set Sync Start Date for historical email import
- Save
Sync behavior:
- Internal domain is auto-detected from company email or mailboxes
- Enable "Exclude Internal Emails" in Settings → Outlook Pro to filter internal traffic
- Internal users (employees with Odoo accounts) are always excluded
- Emails sync automatically every minute
- Set a sync start date to import historical emails (default: sync from now)
Per-contact block list:
- Go to a contact's form view → Email Sync tab
- Enable "Block Email Sync" to exclude that contact from all mailbox sync
Threading uses two methods:
- In-Reply-To header - Standard email threading (works for Inbox)
- Microsoft conversationId - Fallback when headers unavailable (works for Sent Items)
Check logs for "Threading reply to" entries. If replies go to the wrong record, ensure the original email was synced first (conversationId must be stored).
- Check Settings → Technical → Scheduled Actions → "Microsoft Graph: Fetch Incoming Mail"
- Verify mailbox has sync mode enabled
- Verify Sync User has Microsoft connected
- Check logs for
[Incoming Mail]entries
Mailbox configuration incomplete:
- Sync Mode must be set
- Sync User must be set and have Microsoft OAuth connected
User lacks SendAs permission on the mailbox in Microsoft 365. Configure this in Exchange Admin Center.
This module uses Delegated Permissions only - the app acts on behalf of the signed-in user, not as an administrator.
| Aspect | Implementation |
|---|---|
| Authentication | OAuth 2.0 with Microsoft Entra ID |
| Permissions | Delegated only (no admin access) |
| Token storage | Encrypted at rest (Fernet) |
| Shared mailbox | User needs M365 SendAs permission |
See ARCHITECTURE.md for technical details.
- Sync emails from unknown senders
- AI suggests contact qualification (ICP match)
- Human approves, future emails auto-routed
- Customer summaries per company
See ARCHITECTURE.md for detailed roadmap.
See ARCHITECTURE.md for:
- Module structure
- Email flow diagrams
- Design decisions
- API documentation
cd .local
docker-compose stop odoo
docker-compose run --rm odoo python -m odoo -c /etc/odoo/odoo.conf \
-d test_db -u pan_outlook_pro --test-enable --test-tags=pan_outlook_pro --stop-after-init
docker-compose start odooTests cover: internal domain filtering, duplicate detection, partner matching, alias routing.