Office 365
| Schemes | azure://, o365:// |
| Cargo feature | service-office365 |
| Service | https://office.com/ |
| Body formats | html (first is the default) |
| Attachments | yes |
| Title length | 250 characters |
| Body length | 32,768 characters |
| Body lines | unlimited |
| Request throttle | 200 ms between requests |
| Vendor URLs accepted | no |
URL formats
{schema}://{source}/{tenant}/{client_id}/{secret}
{schema}://{source}/{tenant}/{client_id}/{secret}/{targets}
{schema}://{source}/{client_id}/{secret}
{schema}://{source}/{client_id}/{secret}/{targets}
{schema} is one of azure://, o365://.
URL tokens
| Token | Meaning | Type | Required | Default | Notes |
|---|---|---|---|---|---|
{client_id} | Client ID | string | yes | secret; must match ^[a-z0-9-]+$ | |
{secret} | Client Secret | string | yes | secret | |
{source} | Account Email or Object ID | string | yes | ||
{target_email} | Target Email | no | |||
{targets} | Targets | list | no | any of target_email; separated by / | |
{tenant} | Tenant Domain | string | yes | secret; must match ^[a-z0-9-]+$ |
Query parameters
| Parameter | Meaning | Type | Default | Notes |
|---|---|---|---|---|
bcc | Blind Carbon Copy | list | separated by , or space | |
cc | Carbon Copy | list | separated by , or space | |
mode | Mode | choice | org (usually; depends on the URL) | one of org, personal |
oauth_id | Client ID | string | sets {client_id} | |
oauth_secret | Client Secret | string | sets {secret} | |
reply_to | Reply To | list | separated by , or space | |
savesent | Save to Sent Items | bool | yes | |
to | Targets | list | sets {targets} | |
from | Account Email or Object ID | string | sets {source} |
The common URL parameters (format, overflow, verify, redirect, cto, rto, retry, wait, store, tag, tz, user, password, port, optional, emojis) apply as well.
Examples
Accepted URLs (tokens are fake):
o365://hg-fe-dc-ba/tenant/ab-cd-ef-gh/secret/to@example.com
o365://tenant/ab-cd-ef-gh/abcd/123/3343/@jack/test/email1@test.ca
o365://user@live.com/ab-cd-ef-gh/refresh-token-value/to@example.com
o365://user@example.edu/tenant/ab-cd-ef-gh/abcd/123/3343/@jack/test/email1@test.ca
o365://user@live.com/tenant-id/ab-cd-ef-gh/seed/?mode=org
o365://user@example.edu/tenant/ab-cd-ef-gh/secret/email1@test.ca?savesent=no
azure://user@example.edu/tenant/ab-cd-ef-gh/secret/email1@test.ca?format=text
o365://user@example.com/ab-cd-ef-gh/seed/?mode=personal
Rejected URLs:
o365://
o365://:@/
o365://user@example.com/,/ab-cd-ef-gh/abcd/123/3343/@jack/test/email1@test.ca
o365://user2@example.com/tenant/ab./abcd/123/3343/@jack/test/email1@test.ca
Send one from the command line:
mercurio -t 'Backup' -b 'Finished in 42s' 'o365://hg-fe-dc-ba/tenant/ab-cd-ef-gh/secret/to@example.com'
Notes
Office 365 / Microsoft Graph mail (azure://, o365://): e-mail through the Microsoft Graph API.
Organisation (client credentials) mode: o365://{source}/{tenant}/{client_id}/{secret}[/{to_email}...] Personal (refresh token) mode, picked automatically for outlook.com, hotmail., live. and msn.com senders or with ?mode=personal: o365://{source}/{client_id}/{refresh_token}[/{to_email}...]
{source} is the sender e-mail (or, in org mode, a user object id). Options: ?from=..&tenant=..&oauth_id=..&oauth_secret=..&to=..&cc=..&bcc=.. &reply_to=..&mode=org|personal&savesent=yes|no.
The access token is kept (in memory) until expires_in minus 10 s, a rotated refresh token (personal mode) and the looked-up sender (org mode, from / name) go to the persistent store. Attachments above 3 MiB go through a draft + upload session.