Skip to Content
DocsCloud OSConnect Google, Microsoft & iCloud

Connecting Google, Microsoft and iCloud mailboxes

Orbit Mail can read and send from your Gmail, Google Workspace, Outlook.com, Microsoft 365 and iCloud mailboxes next to the node’s own one. This page is for the administrator who sets up the sign-in once for Google and Microsoft, and for anyone connecting an iCloud mailbox. It is free on every plan.

Google and Microsoft do not let a server sign users in until you register your own small “app” with them. It takes about ten minutes per provider and you do it once per node. iCloud and other IMAP providers need no app registration.

Nothing here gives Quazzar, Google or Microsoft access to your mail beyond what each user approves on the consent screen. Tokens and client secrets are encrypted on the node and never appear in logs, API responses or agent output.

Before you start: the public address

Both providers send the browser back to your node after sign-in, so the node needs a public HTTPS address (for example https://cloud.example.com). Google rejects IP addresses and private hostnames.

  1. Sign in as an administrator and open Settings → Mail (/settings?tab=mail).
  2. Check Public base URL. It is pre-filled from the address you are using. If it is not the public HTTPS address people reach your node on, correct it and save. A warning appears while the address is an IP, localhost or not https.
  3. Copy the Redirect URI shown below it with the Copy button. It looks like https://cloud.example.com/api/mail/oauth/callback. You will paste it into Google and Microsoft below. It is read-only; it changes when you change the public base URL, and then the registered redirect URI at the provider must be updated too.

Users can open the node from any hostname when connecting a mailbox; the sign-in always returns to this one address.

Google (Gmail and Google Workspace)

One Google app serves every Google account and every Workspace organisation, including organisations that are separate from each other.

1. Create a Google Cloud project

  1. Go to console.cloud.google.com  and sign in with any Google account (a personal one is fine).
  2. Click the project picker at the top left, then New project.
  3. Name it, for example Quazzar Mail, and click Create. Make sure the new project is selected in the picker.

2. Enable the Gmail API

  1. In the left menu open APIs & Services → Library.
  2. Search for Gmail API, open it and click Enable. Mail itself is read over IMAP, but Google requires this API to be enabled for the mail permission to be offered on the consent screen.
  1. Open APIs & Services → OAuth consent screen (in newer consoles this is Google Auth Platform, with Branding, Audience and Data Access tabs; the steps are the same).
  2. Choose the user type:
    • External (recommended) works for any Google account and any number of Workspace organisations.
    • Internal is only offered when your own account belongs to a Workspace organisation. It has no warning screen and no user limit, but only accounts of that one organisation can connect. Pick it only if every mailbox you connect belongs to that organisation.
  3. Fill in the app name (for example Quazzar Mail), a support email and a developer contact email, then continue.
  4. Under Scopes (or Data Access → Add or remove scopes) add the scope https://mail.google.com/. Search for “Gmail API” in the list, or paste the scope into Manually add scopes. Google marks it as restricted; that is expected. Quazzar also asks for openid and email, which are on by default.
  5. Save.

4. Publish the app to Production

This step matters. For an External app:

  1. On the consent screen page (or Audience), find Publishing status. It shows Testing.
  2. Click Publish app and confirm.

In Testing mode Google expires every sign-in after 7 days, so each mailbox would show Needs reconnect weekly. Always publish to Production. You do not need to submit the app for Google’s verification.

5. Create the OAuth client

  1. Open APIs & Services → Credentials (or Clients) and click Create credentials → OAuth client ID.
  2. Application type: Web application. Name it Quazzar Mail.
  3. Under Authorized redirect URIs click Add URI and paste the Redirect URI you copied from Settings → Mail. It must match exactly, including https and no trailing slash.
  4. Click Create. Google shows the Client ID and Client secret. Copy both.

6. Paste them into Cloud OS

  1. In Settings → Mail, under Google, paste the Client ID and Client secret and save.
  2. The secret is write-only: it is not shown again. Leave the field empty later to keep the stored one.

What users see

Because the app is not verified by Google, the first time each user connects a mailbox they see “Google hasn’t verified this app”. They click Advanced, then Go to Quazzar Mail (unsafe), then allow access to their mail. This is a one-time step per mailbox.

An unverified External app is limited by Google to about 100 users in total. For a team or a family node this is plenty; “users” here are the distinct Google accounts connected. Going beyond requires Google’s app verification, which Cloud OS does not support yet.

Google Workspace organisations

  • Third-party apps restricted? If a Workspace organisation blocks unknown apps, users get “access blocked” or “app not trusted”. The organisation’s administrator opens admin.google.com  → Security → Access and data control → API controls → Manage third-party app access → Add new → OAuth App Name Or Client ID, searches for your Client ID, selects the app and sets it to Trusted. This is done once per organisation; each of your separate organisations needs it.
  • IMAP must be enabled. In the Workspace admin console open Apps → Google Workspace → Gmail → End User Access → POP and IMAP and turn Enable IMAP access on for the organisation or the user’s unit. Personal Gmail accounts have IMAP on by default.
  • Internal alternative. If you only connect mailboxes of your own Workspace organisation, choose Internal in step 3. No unverified-app screen, no user limit, and no Trusted setting is needed for that organisation.

Microsoft (Outlook.com and Microsoft 365)

One Microsoft app serves personal Outlook.com / Hotmail accounts and work or school Microsoft 365 accounts.

1. Register the app

  1. Go to entra.microsoft.com  and sign in. A free personal Microsoft account works; if Entra asks you to create a tenant, accept the free default.
  2. In the left menu open Entra ID → App registrations and click New registration.
  3. Name: Quazzar Mail.
  4. Supported account types: choose Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts (such as Skype, Xbox).
  5. Redirect URI: select platform Web and paste the Redirect URI from Settings → Mail.
  6. Click Register.
  7. On the Overview page copy the Application (client) ID.

2. Create a client secret

  1. In the app, open Certificates & secrets → Client secrets → New client secret.
  2. Give it a description and the longest expiry offered (24 months), then Add.
  3. Copy the secret’s Value now (not the Secret ID). It is shown only once. Note the expiry date: sign-in with Microsoft stops working when it expires, so set a reminder to create a new one and paste it into Settings → Mail.

3. Add the permissions

  1. Open API permissions → Add a permission.
  2. Choose the APIs my organization uses tab and search for Office 365 Exchange Online. Open it, choose Delegated permissions and tick IMAP.AccessAsUser.All and SMTP.Send. Click Add permissions.
  3. Add a second permission, Microsoft Graph → Delegated permissions, and tick offline_access, openid and email. Click Add permissions.
  4. If you are an administrator of the tenant that owns the app, you may click Grant admin consent for your tenant; it is optional for your own tenant.

4. Paste them into Cloud OS

In Settings → Mail, under Microsoft, paste the Client ID and the secret Value. Leave Tenant as common so personal and work accounts both work. Use a specific tenant ID or domain only to restrict sign-in to one organisation. Save.

Microsoft 365 work and school accounts

  • Admin consent. Some organisations do not let users approve apps themselves. The user then sees “Need admin approval”. A tenant administrator approves it once: Entra ID → Enterprise applications → Consent and permissions, or send them the admin-consent link https://login.microsoftonline.com/<their-tenant>/adminconsent?client_id=<Client ID>.
  • SMTP AUTH must be enabled for the mailbox to send. In the Microsoft 365 admin center open Users → Active users → the user → Mail → Manage email apps and tick Authenticated SMTP. Without it reading works but sending fails with an SMTP authentication error. Some tenants also disable it organisation-wide, which an administrator turns off in Exchange admin center under Settings → Mail flow.
  • IMAP must be enabled for the mailbox in the same Manage email apps dialog (it is on by default).

iCloud

iCloud does not use OAuth. Each user creates an app-specific password:

  1. Go to account.apple.com  and sign in. Two-factor authentication must be on.
  2. Open Sign-In and Security → App-Specific Passwords and click Generate an app-specific password (the + button).
  3. Name it Quazzar Mail and copy the password (like abcd-efgh-ijkl-mnop).
  4. In Mail (/mail) click + Connect mailbox → iCloud, enter the full iCloud address and the app-specific password. The servers (imap.mail.me.com, smtp.mail.me.com) are pre-filled.

Use the app-specific password, never your Apple ID password. If you revoke the app-specific password at Apple, the mailbox shows Needs reconnect.

Other IMAP providers

+ Connect mailbox → Other IMAP takes the address, password, IMAP and SMTP host and port, and the security mode (tls or starttls). Hosts that resolve to this machine or to link-local addresses are refused, and so are local network addresses unless you allow them (below). Providers that require an app password (Yahoo, Fastmail and others) need one created in their account settings.

Servers on the local network

By default a custom IMAP or SMTP server must be reachable on a public address. Hosts that resolve to a private network range are refused: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, the carrier-grade NAT range 100.64.0.0/10 and IPv6 unique local addresses fc00::/7.

If your users run their own mail server on the node’s local network (a NAS or an in-house Dovecot, for example), tick Allow custom IMAP/SMTP servers on the local network under Settings → Mail → Custom IMAP/SMTP servers and save.

Think before you turn it on. With it on, any user of this node can make the node connect to hosts on its local network, just by entering one as their mail server. Only allow it when you trust every user with that, or when the node’s network holds nothing worth protecting. The node itself (localhost, 127.0.0.0/8, ::1), link-local addresses (including the cloud metadata service at 169.254.169.254), unspecified and multicast addresses stay refused whatever the setting.

The check runs when a mailbox is connected and again on every connection the node makes, on the address actually dialled, so a DNS name that later points somewhere else cannot get around it. Turning the setting off again stops the node connecting to mailboxes already on the local network within about 30 seconds; they show a red dot (“on the local network, which your administrator has not allowed”) until it is turned back on.

Troubleshooting

SymptomCause and fix
Google / Microsoft button is greyed out with a hintThe administrator has not saved the client ID and secret, or the public base URL is not set. Complete Settings → Mail.
redirect_uri_mismatch (Google) or AADSTS50011 (Microsoft)The redirect URI registered at the provider is not exactly the one shown in Settings → Mail. Copy it again; check https, host and no trailing slash. Update it if you changed the public base URL.
”Google hasn’t verified this app”Expected for an unverified app. Click Advanced → Go to Quazzar Mail (unsafe). Use an Internal app for a single Workspace organisation to avoid it.
Google: “access blocked: app not trusted”The Workspace organisation restricts third-party apps. Its administrator marks the app Trusted (see above).
Google asks to reconnect every weekThe app is still in Testing. Publish it to Production, then reconnect each mailbox once.
Needs reconnect on a mailboxThe provider revoked the sign-in (password change, access removed, Testing expiry, expired Microsoft client secret) or the iCloud / IMAP password changed. Expand the mailbox in the rail and click Reconnect. Syncing for that mailbox is paused until then; the others keep working. You also get one notification in the bell.
Microsoft: “Need admin approval”The tenant requires administrator consent. See the Microsoft 365 notes above.
Microsoft: sending fails, reading worksAuthenticated SMTP is off for that mailbox. Enable it in the Microsoft 365 admin center.
Google: sign-in works but the mailbox will not syncIMAP is disabled for that Workspace user. Enable IMAP in the Gmail admin settings.
”Mailbox already connected”That address and kind is already in your list. Use Reconnect on it instead.
”That server address isn’t allowed” (invalid_host) when connecting an IMAP mailboxThe IMAP or SMTP host resolves to this machine, a link-local address, or a local network address. Use the server’s public host name. If the server really is on your local network, an administrator can allow that under Settings → Mail (see Servers on the local network); this machine and link-local addresses are never allowed.
Microsoft sign-in stopped for everyoneThe client secret expired. Create a new one (step 2) and paste it into Settings → Mail.

See Orbit Mail for day-to-day use and Agent access to let agents work with these mailboxes.