Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Office 365

Schemesazure://, o365://
Cargo featureservice-office365
Servicehttps://office.com/
Body formatshtml (first is the default)
Attachmentsyes
Title length250 characters
Body length32,768 characters
Body linesunlimited
Request throttle200 ms between requests
Vendor URLs acceptedno

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

TokenMeaningTypeRequiredDefaultNotes
{client_id}Client IDstringyessecret; must match ^[a-z0-9-]+$
{secret}Client Secretstringyessecret
{source}Account Email or Object IDstringyes
{target_email}Target Emailemailno
{targets}Targetslistnoany of target_email; separated by /
{tenant}Tenant Domainstringyessecret; must match ^[a-z0-9-]+$

Query parameters

ParameterMeaningTypeDefaultNotes
bccBlind Carbon Copylistseparated by , or space
ccCarbon Copylistseparated by , or space
modeModechoiceorg (usually; depends on the URL)one of org, personal
oauth_idClient IDstringsets {client_id}
oauth_secretClient Secretstringsets {secret}
reply_toReply Tolistseparated by , or space
savesentSave to Sent Itemsboolyes
toTargetslistsets {targets}
fromAccount Email or Object IDstringsets {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.