Microsoft 365 and Outlook.com
Connect an Office 365 work account, a shared mailbox, or a personal Outlook.com or Hotmail account.
Airpost has two Microsoft options on the Connect an email account screen. Both sign in through your browser with OAuth, then read and send mail over IMAP and SMTP using that token. Airpost never sees your Microsoft password.
| Option | Use it for | CLI --provider |
|---|---|---|
| Office 365 | Work or school accounts on Microsoft 365, including shared mailboxes. | office365 |
| Outlook.com / Hotmail | Personal Microsoft accounts (outlook.com, hotmail.com, live.com and similar). | outlook |
Connect the account
Choose the Microsoft option
Pick Office 365 or Outlook.com / Hotmail.
Sign in in your browser
Airpost opens Microsoft’s sign-in page. Sign in, approve the permissions, and the browser hands control back to Airpost on localhost. If the browser doesn’t open, copy the URL Airpost shows.
Wait for the connection test
The engine logs in to IMAP and SMTP with the new token before it keeps the account. If either fails, you see the server’s error instead of a half-working account.
What Airpost asks Microsoft for
| Scope | Used for |
|---|---|
openid, email, profile, user.read | Your address and name. |
offline_access | A refresh token, so you don’t sign in every hour. |
IMAP.AccessAsUser.All | Reading and organizing mail over IMAP. |
SMTP.Send | Sending over SMTP. |
Contacts.ReadWrite, Contacts.ReadWrite.Shared, Calendars.ReadWrite, Calendars.ReadWrite.Shared | Requested at sign-in for contacts and calendars. |
Microsoft issues a separate access token per resource, so the engine refreshes the IMAP and SMTP token explicitly each time it renews. The refresh token lives in your OS keychain like every other credential (see Accounts). If you self-host or build from source, AIRPOST_O365_CLIENT_ID in the engine’s environment points sign-in at your own Azure app registration.
Office 365
Office 365 accounts need IMAP and Authenticated SMTP turned on for the mailbox. Many organizations turn them off by default. If sign-in succeeds in the browser but the account fails its connection test, ask your admin to enable both for your mailbox in the Microsoft 365 Admin Center (Users > Active users > your user > Mail > Manage email apps). Some tenants also require admin consent before any third-party app can sign in; that shows as an error on Microsoft’s sign-in page.
Outlook.com and Hotmail
Personal accounts usually work out of the box. If the connection test fails, check that IMAP and POP access is allowed in Outlook.com’s settings under Mail > Forwarding and IMAP.
How Exchange differs from other IMAP servers
The engine detects Exchange by host name (office365.com, outlook.com) or by its greeting, and adjusts:
- No custom keywords. Exchange doesn’t let clients store IMAP keywords, and Outlook categories aren’t exposed over IMAP, so Airpost labels aren’t available on Microsoft accounts. Use folders.
- Late Sent copies. Exchange files its own copy of a sent message in Sent Items, sometimes minutes after sending. The engine watches for that copy and cleans up duplicates instead of saving a second one.
- Transient LIST errors. A
NOanswer to a folder listing is treated as a connection problem and retried, not as a fatal error.
Shared mailboxes
You can add an Office 365 shared mailbox as its own account. It signs in with your own Microsoft account and opens the shared mailbox’s address over IMAP.
Open the Office 365 account
In Preferences > Accounts, select your Office 365 account.
Add the shared mailbox
Under Connection, click Add shared mailbox… and enter the Shared mailbox address.
Sign in with your own account
Sign in with your own Office 365 account in the browser. The shared mailbox appears as a separate account in the sidebar.
From the CLI:
airpost account add team@company.com --provider office365 --shared-mailbox team@company.com
--shared-mailbox works only with --provider office365.
| Permission on the shared mailbox | Effect |
|---|---|
| Full Access | Required to read mail. |
| Send As | Required to send from the shared address. Without it the mailbox connects read-only and sending fails. |
Your admin grants both in the Exchange admin center. Permission changes can take a while to reach IMAP; if a new grant doesn’t work right away, wait and use Reconnect.
Calendar and contacts
Airpost syncs calendars and contacts over CalDAV and CardDAV (and the People API for Google). Microsoft 365 and Outlook.com don’t offer CalDAV or CardDAV, so Microsoft accounts don’t have calendars or contacts in Airpost today. See Calendar and contacts.
If sign-in stops working
Password changes, conditional-access policies and admin revocations all invalidate the refresh token. The account then shows “Airpost can’t sign in”. Click Reconnect or Sign in again…, or:
airpost account reauth you@company.com