Connect Microsoft 365 or Google Workspace
Connect your mail tenant step by step, understand every permission requested and confirm that messages are being analysed.
On this page
Licence required: Email.
How the connection works
HOSSIDARK Email runs in parallel to your mail system, never in its delivery path. Mail keeps flowing through Microsoft 365 or Google Workspace exactly as today; the appliance reads new messages through the provider's official API, analyses them locally and, when you decide, removes or quarantines them through the same API. If the appliance is stopped, mail delivery is not affected.

The connection is one tenant-level identity for your organisation. No password of any user is stored, no port is opened on the appliance by default, and the credential stays on the appliance only.
Prerequisites
| Item | Detail |
|---|---|
| Licence | Email module active (Settings > Licence shows Email) |
| Account | Microsoft 365 Global Administrator / Privileged Role Administrator, or Google Workspace Super Admin |
| Network | Outbound HTTPS (TCP 443) from the appliance to graph.microsoft.com and login.microsoftonline.com, or gmail.googleapis.com, oauth2.googleapis.com and admin.googleapis.com |
| Console role | Administrator with fresh MFA |
Microsoft 365 — direct connection (recommended)
The appliance talks only to Microsoft; no HOSSIDARK server takes part and nothing leaves your infrastructure except the calls to your own Microsoft 365 tenant.
- Open Email > Connections and select Connect Microsoft 365 after entering your SOC mailbox.
- The console shows a one-time code and the Microsoft sign-in address (also as a QR code). The code expires after at most 30 minutes.
- On any PC or phone, open the address, enter the code and sign in with a Global Administrator account. Any other role is refused.
- The appliance creates the application HOSSIDARK Email Defence in your tenant, attaches its own certificate (the private key never leaves the appliance; no password is created) and grants these permissions:
| Permission | Required | Why it is needed |
|---|---|---|
Mail.ReadWrite | Yes | Read inbound and outbound mail of every mailbox and remove threats |
Mail.Send | Yes | Forward suspect messages, sealed, to your own SOC mailbox |
MailboxSettings.ReadWrite | Yes | Read and disable malicious inbox rules and forwarding |
User.Read.All | Yes | Discover every mailbox of the organisation |
AuditLog.Read.All | No | Correlate sign-ins to detect account takeover |
Directory.Read.All | No | Read groups, shared mailboxes and roles |
- The sign-in is used once and discarded. The appliance then proves each permission with a harmless read and shows Working, Missing or Not tested. Connected appears only when every required permission works; Microsoft may take a few minutes to activate a new application.
- Every mailbox of the organisation appears with inbound (Inbox) and outbound (Sent Items) mail, inbox rules and forwarding, and real-time sync starts.
To disconnect, use Disconnect in the console and remove HOSSIDARK Email Defence from Microsoft Entra → Enterprise applications.
Google Workspace — domain-wide delegation
- In Google Cloud, create a service account for HOSSIDARK and download its JSON key.
- In Email > Settings > General, choose Google Workspace and upload the key.
- Select Open delegation link. It opens Google Admin with the client ID and all scopes pre-filled:
gmail.modify— read new mail and remove threatsgmail.settings.basic— read filters and forwardingadmin.directory.user.readonly— discover mailboxes and identitiesadmin.reports.audit.readonly— correlate sign-ins
- Authorise, return to the console, enter an administrator address for impersonation and select Test connection.
Isolated tenants — manual form or SMTP journal
If the direct connection cannot be used, the manual form accepts an application ID, tenant ID and certificate you register yourself. A journal over SMTP is also possible, but only with TLS, an allow-list of sending servers and an explicit management address; it never listens on every interface and never accepts clear text.
Verify
- The connection status moves to Receiving when the first messages arrive.
- Email > Overview shows messages analysed and the latency from provider arrival to analysis.
- High-risk mailboxes are polled every 5 seconds, others every 30 seconds; a provider "retry after" instruction always wins.
- Inbox rules and forwarding are read every hour.
Troubleshooting
| Symptom | Cause and fix |
|---|---|
| Sign-in code expired | Start again; each code works once for at most 30 minutes |
| Account is not a Global Administrator | Sign in again with a Global Administrator of the tenant |
| Status stays Waiting | No new mail yet, or outbound 443 blocked — test from Terminal > Communication |
AADSTS700027 | Email licence revoked or certificate replaced; sync stops as "disabled — licence". Check the licence, then reconnect |
Google unauthorized_client | Delegation not saved or scopes missing; reopen the delegation link |
| Actions show "not executed" | The platform has no write permission; review the permissions above |
Ingestion is idempotent: a message is never analysed twice, and originals and analyses are stored before being acknowledged.