Email

Connect Microsoft 365 or Google Workspace

Connect your mail tenant step by step, understand every permission requested and confirm that messages are being analysed.

Licence required · email4 min read
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.

How mail reaches the appliance

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

ItemDetail
LicenceEmail module active (Settings > Licence shows Email)
AccountMicrosoft 365 Global Administrator / Privileged Role Administrator, or Google Workspace Super Admin
NetworkOutbound 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 roleAdministrator with fresh MFA

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.

  1. Open Email > Connections and select Connect Microsoft 365 after entering your SOC mailbox.
  2. 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.
  3. On any PC or phone, open the address, enter the code and sign in with a Global Administrator account. Any other role is refused.
  4. 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:
PermissionRequiredWhy it is needed
Mail.ReadWriteYesRead inbound and outbound mail of every mailbox and remove threats
Mail.SendYesForward suspect messages, sealed, to your own SOC mailbox
MailboxSettings.ReadWriteYesRead and disable malicious inbox rules and forwarding
User.Read.AllYesDiscover every mailbox of the organisation
AuditLog.Read.AllNoCorrelate sign-ins to detect account takeover
Directory.Read.AllNoRead groups, shared mailboxes and roles
  1. 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.
  2. 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

  1. In Google Cloud, create a service account for HOSSIDARK and download its JSON key.
  2. In Email > Settings > General, choose Google Workspace and upload the key.
  3. Select Open delegation link. It opens Google Admin with the client ID and all scopes pre-filled:
    • gmail.modify — read new mail and remove threats
    • gmail.settings.basic — read filters and forwarding
    • admin.directory.user.readonly — discover mailboxes and identities
    • admin.reports.audit.readonly — correlate sign-ins
  4. 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

SymptomCause and fix
Sign-in code expiredStart again; each code works once for at most 30 minutes
Account is not a Global AdministratorSign in again with a Global Administrator of the tenant
Status stays WaitingNo new mail yet, or outbound 443 blocked — test from Terminal > Communication
AADSTS700027Email licence revoked or certificate replaced; sync stops as "disabled — licence". Check the licence, then reconnect
Google unauthorized_clientDelegation 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.