Skip to content

Email through Microsoft 365 and Google Workspace ​

Syncplify Server! sends mail on your behalf: notifications to SuperAdmins and Admins, the invitations WebClient! users send when they share a file or a folder, and whatever an event handler script sends with SendMail(). Until version 8.14.0 all of it left through an SMTP server, with a user name and a password.

Microsoft and Google are both retiring that way of signing in. Microsoft 365 turns password sign in for SMTP off by default for existing tenants at the end of December 2026. Google Workspace has not accepted an account password over SMTP since March 2025, and accepts only an app password, which needs 2 Step Verification on the sending account.

From version 8.14.0 the mail settings have a Delivery method. Two of the three methods do not use SMTP at all: they hand the message to the provider's own API over HTTPS, signed in as an application you register with the provider. No user name and no password are involved, and nothing has to be signed in to by a person, now or later.

Delivery methodHow the message leavesWhat you set up with the provider
SMTP serverSMTP, with a password or with no sign in at allNothing new. This is what every configuration saved before 8.14.0 uses, and it keeps working unchanged.
Microsoft 365Microsoft Graph, over HTTPSAn app registration with one permission, Mail.Send.
Google WorkspaceGmail API, over HTTPSA service account, delegated one scope, gmail.send.

Both provider methods can send, and nothing else. Neither can read or delete mail.

Where the settings are ​

There are two sets of mail settings, and each has its own delivery method:

  • The global settings, on the Email section of Global Configuration in the SuperAdmin UI, send the notifications to SuperAdmins and Admins.
  • The settings of each virtual site, on the SMTP page of the Admin UI, send share invitations and the messages of SendMail().

Set up the provider once, as described below, and enter the same values in both places if both should send through it.

Microsoft 365 ​

You need an administrator of the Microsoft 365 tenant for steps 1 to 4, and a mailbox to send from. A shared mailbox is a good choice: it needs no license and no person signs in to it.

  1. In the Microsoft Entra admin center, open Identity, Applications, App registrations, and choose New registration. Give it a name you will recognize, for example Syncplify Server mail, leave Accounts in this organizational directory only selected, leave the redirect URI empty, and choose Register.
  2. On the Overview page of the new registration, copy the Application (client) ID and the Directory (tenant) ID.
  3. Open API permissions, choose Add a permission, Microsoft Graph, Application permissions, tick Mail.Send, and choose Add permissions. Then choose Grant admin consent for your organization. The permission must show as granted.
  4. Open Certificates & secrets, choose New client secret, pick how long it is valid, and choose Add. Copy the Value right away: it is shown only once. The Secret ID next to it is not the secret.
  5. In Syncplify Server!, choose the delivery method Microsoft 365 and enter:
    • Sender address: the address of the mailbox the mail is sent from.
    • Directory (tenant) ID and Application (client) ID: the two values from step 2.
    • Client secret: the value from step 4.
  6. Save, then use the test action and send yourself a message.

Things to know:

  • The client secret expires. Microsoft lets a secret live for at most two years. When it expires, mail stops, and the test says that the provider refused the credentials. Note the expiry date when you create the secret, create a new one before that date, and replace it in the settings.
  • By default the app may send as any mailbox of the tenant. That is what the Mail.Send application permission means. To limit it to the one mailbox, see the next section.
  • The message is kept in the Sent Items of the mailbox.
  • The From address must be the mailbox, or an address that mailbox is allowed to send as. A script that passes another address to SendMail() is refused by Microsoft.
  • Large attachments. Microsoft Graph accepts a message of only a few megabytes in one request: Microsoft documents 3 MB as the largest file that can be attached that way, and anything larger needs a second permission that would let the application read and change the mailbox, which Syncplify Server! deliberately does not ask for. A script that attaches a larger file gets false from SendMail() and a log line that says the message is too large. Share invitations and notifications carry no attachments and are never affected.
  • Clouds. The worldwide Microsoft cloud is supported, which includes GCC. The US Government GCC High and DoD clouds and Microsoft 365 operated by 21Vianet use other addresses and are not supported in this version.

Limiting the app to one mailbox ​

Microsoft's own mechanism for this is Role Based Access Control for Applications in Exchange Online. The permission is then granted in Exchange, for a scope you define, and not for the whole tenant in Entra. In Exchange Online PowerShell, as an Exchange administrator:

powershell
# The object ID is the one shown under Enterprise applications, not under App registrations.
New-ServicePrincipal -AppId <application (client) ID> -ObjectId <object ID> -DisplayName "Syncplify Server mail"

New-ManagementScope -Name "Syncplify Server mailbox" -RecipientRestrictionFilter "PrimarySmtpAddress -eq 'files@example.com'"

New-ManagementRoleAssignment -App <application (client) ID> -Role "Application Mail.Send" -CustomResourceScope "Syncplify Server mailbox"

Test-ServicePrincipalAuthorization -Identity <application (client) ID> -Resource files@example.com

Then remove Mail.Send from the API permissions of the app registration in Entra. The two grants add up: as long as the tenant wide one exists, the scope limits nothing. Microsoft states that such a change takes between 30 minutes and 2 hours to apply.

Google Workspace ​

You need a super administrator of the Google Workspace for step 5, and a Workspace user to send as. This method is for Google Workspace only; a personal Gmail account cannot use it.

  1. In the Google Cloud console, create a project or pick an existing one. Open APIs & Services, Library, find Gmail API, and choose Enable.

  2. Open IAM & Admin, Service Accounts, and choose Create service account. Give it a name, for example syncplify-server-mail. It needs no role and no access to the project; skip those steps.

  3. Open the new service account, go to Keys, choose Add key, Create new key, JSON, and Create. A .json file is downloaded. That file is the key: keep it safe until you have loaded it into Syncplify Server!, then delete it.

  4. In Syncplify Server!, choose the delivery method Google Workspace, enter the Sender address (the address of the Workspace user the mail is sent as), choose the key file, and save. The page now shows the Service account and the Client ID for delegation it read from the key.

  5. In the Google Admin console, signed in as a super administrator, open Security, Access and data control, API controls, and choose Manage Domain Wide Delegation. Choose Add new and enter:

    • Client ID: the Client ID for delegation shown in step 4. It is a long number, not an address.
    • OAuth scopes: https://www.googleapis.com/auth/gmail.send

    Choose Authorize.

  6. Back in Syncplify Server!, use the test action and send yourself a message.

Things to know:

  • Delegation takes time to apply. Google states up to 24 hours, though it is usually a matter of minutes. Until then the test says that the credentials are valid but are not allowed to send as this mailbox.
  • Grant the one scope above and no other. With gmail.send the service account can send as a user of your Workspace and cannot read or delete anything. Syncplify Server! asks Google for that scope only, so granting a wider one gains nothing.
  • Your organization may not allow service account keys. Google Cloud organizations created since 2024 often enforce the policy iam.disableServiceAccountKeyCreation, and step 3 then fails. Someone with the Organization Policy Administrator role has to allow key creation for the project first.
  • The From address must be the user, or one of the addresses that user has set up under "Send mail as". Gmail replaces any other From address with the user's own.
  • A copy is kept in the Sent folder of the user.
  • Replacing the key. Create a new key for the service account, choose the new file in the settings, save, and delete the old key in Google Cloud. The delegation stays, because it belongs to the service account and not to the key.

Mailbox ​

For both provider methods the settings have an optional Mailbox field. Leave it empty in the common case, where the sender address is the mailbox itself.

Fill it in when the two differ: the mail is sent through the mailbox you name, and the From header carries the sender address. The mailbox must be allowed to send as that address (a "send as" right in Microsoft 365, a "Send mail as" address in Gmail).

Testing, and what a failure means ​

The test action on both settings pages sends one message with the settings as they are on the page, saved or not. It does not need you to enter a secret again: for anything the page does not hold, the stored value is used.

A failed test says what kind of failure it was and adds the provider's own words. The same words appear in the log when a notification (event 9030, EmailFailed, see Log event IDs), a share invitation or a script fails to send.

The test saysWhat to check
The mail settings are incompleteA required field is empty, or the key file is not a service account key.
The mail provider refused the credentialsMicrosoft 365: the tenant ID, the client ID, the client secret (the Value, not the Secret ID), and whether the secret has expired. Google Workspace: whether the key was deleted in Google Cloud, and whether the clock of the server is right.
The credentials are valid, but they are not allowed to send as this mailboxMicrosoft 365: Mail.Send was added as an Application permission and admin consent was granted, and a scope, if you defined one, includes the mailbox. Google Workspace: the delegation is authorized for the Client ID shown on the page with exactly the scope above, enough time has passed, and the Gmail API is enabled in the project.
The mail provider does not know the mailboxThe sender address, or the Mailbox field when you use it, is not a mailbox of the tenant or a user of the Workspace with Gmail turned on.
The mail provider could not be reached or is not answeringThe server cannot reach the provider. See the next section.
The mail provider refused the test messageThe provider's own words say why, for example a From address the mailbox may not send as.

Network ​

Every node sends this mail itself, from the Web/REST service and from the workers of each virtual site. Each needs outbound HTTPS, port 443, to:

Delivery methodHosts
Microsoft 365login.microsoftonline.com and graph.microsoft.com
Google Workspaceoauth2.googleapis.com and gmail.googleapis.com

A proxy set through the usual HTTPS_PROXY and NO_PROXY environment variables of the services is honored. No inbound connection is needed, and none of this depends on the address the server is reached at.

How the secrets are kept ​

  • The client secret and the service account key are stored encrypted, like every other secret of the configuration. No page and no API shows them again; a page shows only that one is set.
  • The service account key never leaves the server. It signs a request to Google and is not sent.
  • The access tokens the providers hand out are valid for about an hour, are kept in memory only, and are asked for again when they run out.
  • A stored SMTP password is never sent to a new server. If you change the host or the port of an SMTP server that signs in with a stored password, the settings page asks you to enter the password again before it saves or tests. Without this rule, somebody allowed to edit the mail settings, and not allowed to see the password, could point the server at a host of their own and read the password there.