This type of email server connection will be authenticated with the help of your email provider's API.
Prerequisites
To configure the email server using an API, choose one of the following as your email provider:
Email server configuration using an API with Microsoft Azure as your email provider
If you are using Microsoft Azure as your mail provider, find the Azure tenant ID, Client ID, and Client Secret using the steps listed below:
Email server configuration using an API with Google as your email provider
If you are using Google as your email provider, then perform the following:
Steps to find the JSON private key
- Go to https://console.developers.google.com/ and log in to your Google Account.
- Navigate to the Service Accounts page.
- Click the Select a project drop-down and click NEW PROJECT.
- Click + CREATE SERVICE ACCOUNT. In the Service account details window, specify the Service account name, Service account ID, and Service account description. Click CREATE AND CONTINUE.
- Click Grant this service account access to project to select the IAM roles required for the service account.
- Click CONTINUE.
- Add the users and groups that you want to allow to access and manage the service account.
- Click DONE.
- Select the email address of the service account created.
- In the Keys section, select Create new key from the ADD KEY drop-down.
- Select JSON as the key type.
- Click CREATE.
- The JSON private key will be generated and downloaded to your local system. A new private key will be generated each time, so once generated, it is vital to keep the key secure.
Steps to enable Gmail's API service
Steps to provide domain-wide authority to the service account
- Log in to the Google Workspace Admin Console as a super administrator.
- Go to Security > Access and data control > API controls.
- Under the Domain wide delegation pane, choose MANAGE DOMAIN WIDE DELEGATION.
- Click Add new.
- Type in your service account's Client ID from this page.
- In the OAuth scopes (comma-delimited) field, select the scopes that your application needs access to. If it needs domain-wide access to the Gmail API, then type in https://mail.google.com.
- Click AUTHORIZE.
The application now has the authority to make API calls as users within your domain.