Using OAuth 2.0 when sending outbound emails in Syncrify
Microsoft offers the following methods for relaying messages from MFP devices or on-premises application servers. The methods are described in detail on this page.
- Method 1 - Client SMTP Submission. This method requires OAuth 2.0 authentication. This page discusses using OAuth with Syncrify for outbound emails.
- Method 2 - SMTP Relay. This is done by either specifying your public IP address or using an SSL certificate for authentication. Refer to this page for detailed instructions on using this method.
- Method 3 - Direct Send. This method requires you to authorize your public IP address to send emails for your domain by adding it to your SPF record and assigning a DKIM key. You can use Xeams if you wish to use this method.
Prerequisites for using OAuth
Before using OAuth, you must register an app and add Syncrify's URL as an authorized address. Although the following steps assume you're using Microsoft Exchange Online, similar steps are available for other OAuth servers.
Registering an App with Microsoft
- Visit https://portal.azure.com and log in
- Enter "App registration" in the search bar after logging in to your Azure account.
- Enter a name for your app.
- You will see two additional fields further down on this screen. Select "Web" and enter the URL for your Syncrify server. This can be either "localhost" for the hostname or your complete FQDN as used in Syncrify. Click Register.
- Next, click Manage/Certificates & secrets on the left.
- Select the Client secret tab, and click New client secret. Give it a name and click the Add button. IMPORTANT: Copy the generated secret into a document. You will need this information in Syncrify.
- Next, click API permissions, and add a permission for SMTP.Send. You may have to click Microsoft Graph and search for SMTP before this permission is displayed.
- Click Overview. Copy the Client ID.
- Click Endpoints, and copy the URL for the OpenID Connect metadata document towards the bottom of that page.
Once done, you should have the following information:
- A client ID
- A client secret
- A URL for OpenID Connect metadata document
Configuring Syncrify
- Log in as the administrator
- Click Configuration
- Select OAuth 2.0 from Authentication Type, and click the Configure OAuth button.
- Assign the login email for your Microsoft account.
- Copy/paste the values for Open ID URL Endpoint, Client ID, and Client Secret.
- Use
https://outlook.office.com/SMTP.Send offline_access for the scope field
- Click Save
Once saved, you should see an Access Token on the configuration page, along with its expiration date.
Click the Test button to confirm emails are being sent.