| Audience: DocuShare, Microsoft Entra, and Exchange Online administrators |
Applies To
- DocuShare 7.6 with the latest patch.
- DocuShare 7.7 with the latest patch.
- DocuShare 8.0 and 8.1.
Overview
Configure DocuShare to send outbound system email through Exchange Online using Microsoft 365 OAuth 2.0 and the dsemailService utility. This configuration uses an application identity and client secret rather than a mailbox password. It can affect subscription, workflow, and Lifecycle Manager email. It does not configure inbound Email Agent mail retrieval.
The steps below use a single-tenant Microsoft Entra application and the Exchange Online application-permission and mailbox-permission setup. Your Microsoft 365 administrators must approve and perform the tenant and mailbox changes.
Before You Begin
- Identify an Exchange Online sender mailbox and an authorized DocuShare administrator. Have Microsoft Entra and Exchange Online administrators available to configure the application, grant consent, and assign the mailbox permissions.
- Confirm that SMTP AUTH is permitted for the sender mailbox under your organization's security policies. Do not disable tenant security controls without your security administrator's approval.
- Confirm that the DocuShare server can reach smtp.office365.com on TCP port 587 and the Microsoft Entra authentication endpoint on HTTPS port 443. Microsoft 365 SMTP requires STARTTLS with TLS 1.2 or later. Have your network administrator verify DNS, firewall, proxy, certificates, and trust settings.
- Schedule a maintenance window: dsemailService requires DocuShare to be stopped. Record the current mail settings and prepare a recovery plan before changing them.
| Important: Do not send secrets, tokens, or unredacted configuration files to Support. |
1. Register the Microsoft Entra Application
- In the Microsoft Entra admin center, open Entra ID > App registrations and select New registration. Enter a recognizable name and select Accounts in this organizational directory only, unless your organization has approved a different design. Select Register.
- On the application Overview page, record the Application (client) ID and Directory (tenant) ID. These values are required by dsemailService.
- Open Certificates & secrets > Client secrets and create a client secret using an expiration period approved by your organization. Copy the secret VALUE securely when it is created; the secret ID is not the value used by DocuShare. Plan to rotate the secret before it expires.
- Open API permissions > Add a permission. Under APIs my organization uses, select Office 365 Exchange Online > Application permissions > SMTP.SendAsApp. Add the permission and have an authorized tenant administrator grant admin consent.
The SMTP.SendAsApp application permission and admin consent do not by themselves grant access to an individual mailbox. Complete the Exchange Online steps below.
2. Authorize the Exchange Online Mailbox
- In Microsoft Entra, open Enterprise applications and select the application you registered. On its Overview page, record the enterprise application's Object ID. This is the service-principal Object ID, not the Object ID on the App registrations page.
- An Exchange administrator connects to the correct tenant using Exchange Online PowerShell. If the application does not already have an Exchange service principal, register it using New-ServicePrincipal: set -AppId to the Application (client) ID and -ObjectId to the enterprise application's Object ID.
- Use Get-ServicePrincipal to identify the resulting Exchange service principal and its Identity. Grant it FullAccess to the intended sender mailbox using Add-MailboxPermission: set -Identity to the sender mailbox, -User to the Exchange service principal Identity, and -AccessRights to FullAccess. Grant access only to the required mailbox and follow your organization's approval process.
- Verify that SMTP AUTH is enabled for the sender mailbox and permitted by the effective organization and mailbox settings. Check the Microsoft guidance and your security policies before making changes.
- For the exact Exchange Online PowerShell syntax and Microsoft prerequisites, please refer to Microsoft regarding Authenticating an IMAP, POP or SMTP connection using OAuth.
- For SMTP AUTH settings, please refer to Microsoft regarding enabling and disabling SMTP AUTH in Exchange Online.
3. Configure dsemailService
| Important: The utility can create or change configuration files before the final confirmation, especially during first-time setup. If configuration is canceled, interrupted, or reports an error, review the files with Support before restarting DocuShare. |
- Stop DocuShare using your normal procedure and confirm that it has stopped. Securely back up emailService.properties, DSCommon.properties, and Subscription.properties from the DocuShare config directory, if present. Record which files did not exist and store the backups outside the active configuration directory.
- Open a private administrative command prompt or shell on the DocuShare server. From the installation's bin directory, run dsemailService.bat on Windows or ./dsemailService.sh on Linux.
- If enabling the service for the first time, confirm the warning. Review the current configuration and choose Yes when prompted to update it. At SMTP Type, select MS365 (shown as 3 in the configuration guide). If MS365 is not offered, stop and contact Support to review the configuration and verify the version and patch level before restarting.
- Enter the following values at the prompts. Use the actual menu and prompt labels shown by your installation:
- MS365 SMTP Host: smtp.office365.com for Microsoft 365 commercial Exchange Online. Confirm the endpoint with your Microsoft 365 administrator if your environment uses a different cloud.
- MS365 SMTP Port: 587.
- MS365 SMTP Client Id: the Application (client) ID of the registered Entra application.
- MS365 SMTP Client Secret: the client secret VALUE, not the secret ID. Enter it only at the prompt, not as a command-line argument.
- MS365 SMTP Tenant Id: the Directory (tenant) ID.
- MS365 SMTP Sender Address: the email address of the Exchange Online mailbox authorized for the application.
- SMTP Timeout and SMTP Connection Timeout: retain the existing values unless your email administrator recommends a change. Values are in milliseconds; the connection timeout controls connection establishment.
- Confirm the configuration. Review the entire utility output for errors; a success message or exit code alone does not prove that every configuration file was updated. If there are errors or uncertainty, contact Support before restarting.
- Start DocuShare using your normal procedure.
4. Verify Email Delivery
- If you use subscription notifications, open Admin Home > Services > Subscription and confirm that subscriptions are enabled and the Subscription Administrator Email is configured. Apply any approved changes.
- Create or use a test subscription and trigger a non-sensitive test event. Confirm that the intended recipient receives the message and that the sender address is correct. Test other affected workflows, if applicable.
- If delivery fails, review relevant DocuShare and Exchange Online logs. Check network and TLS connectivity, the client ID, tenant ID, secret value and expiration, admin consent, enterprise application Object ID, Exchange service-principal registration, mailbox permissions, and SMTP AUTH settings.
- If a sender address differs from the authorized mailbox, have your Exchange administrator verify the applicable Send As permission and tenant policy. Do not include credentials or access tokens in diagnostic requests.
Rotate the Client Secret
Before the existing client secret expires, have the Entra administrator create a replacement secret. During a maintenance window, stop DocuShare, back up the configuration, and run dsemailService to enter the new secret value. Start DocuShare and verify email delivery. After the new secret is confirmed working, retire the old secret according to your security policy.
Related Information
For DocuShare assistance, contact DocuShare Customer Technical Support.
Comments
0 comments
Article is closed for comments.