The following instructions can be used to configure a Mail Server that connects to Gmail using OAuth2.
These instructions apply to the Email Document Loader Job as well, although the ports will be different.
Enter the following details:
Name | Gmail |
Description | Account settings for Gmail |
Host | smtp.gmail.com |
Port | 587 |
Timeout | 120 |
Connection Security | STARTTLS |
Authentication Method | OAuth2 - Gmail |
The first time this is done, a New OAuth2 Client Registration window will be displayed.
This prompts for the following details:
These are obtained in the following steps. Note the Redirect URI.
ix. On completion, Your non-sensitive scopes should display:
while Your restricted scopes should display:
iv. Click SAVE AND CONTINUE
i. Under APIs & Services, select Credentials
ii. Click CREATE CREDENTIALS
iii. Click OAuth client ID
iv. Under Create OAuth client ID, enter
A popup will display, containing the Client ID and Client Secret:
Click OK. This should automatically start the Authorise flow. A new browser will be displayed.
After logging in, follow the prompts, and select 'Read, compose, send and permantly delete all your mail from Gmail'
Click Continue.
In the Mail Server window, click Check Authorisation.
If successful, the Gmail account will appear in the Username field. Click OK.
Authorisation will fail if details haven't been entered correctly. Google error messages can be range from the helpful "Access blocked: authorisation error. The OAuth client was deleted" (indicating that a OAuth 2.0 Client IDs has been deleted in the Google console), to the not so helpful "Sorry, something went wrong there. Try again".
If authorisation fails, ensure that the:
1. The Client Id and Client Secret from step 7 v. have been correctly entered in the OAuth2 Client Registration window in step 8.
2. Authorized redirect URI in step 7 iv matches that shown in step 8.
3. Scopes match those in step 5 ix.
If the above all match, try performing authorisation in a different browser. The "Sorry, something went wrong there. Try again" error has been seen in Firefox (117.0), but was resolved by using Google Chrome (116.0).
The following instructions can be used to configure a Mail Server that connects to Microsoft Outlook using OAuth2.
These instructions apply to the Email Document Loader Job as well, although the ports will be different.
Enter the following details:
Name | Microsoft Outlook |
Description | Account settings for Microsoft Outlook |
Host | smtp.office365.com |
Port | 587 |
Timeout | 120 |
Connection Security | STARTTLS |
Authentication Method | OAuth2 - Outlook |
The first time this is done, a New OAuth2 Client Registration window will be displayed.
This prompts for the following details:
These are obtained in the following steps. Note the Redirect URI.
Select Manage Azure Active Directory
This displays a Register an application page.
Enter:
This displays an Overview page.
The Application (client) ID is copied into the Client Id field in step 3
The Directory (tenant) ID is copied into the Tenant Id field 3
This displays a popup. Enter:
This displays the new secret. The Value field must be copied to the Client Secret field in step 3.
This displays a Request API permissions popup.
Select Microsoft Graph.
Then select the permissions:
Click Add permissions.
On completion, API permissions should look as follows:
Back in the OAuth2 Client Registration editor, enter the Tenant Id, Client Id and Client Secret.
Click OK. This should automatically start the Authorise flow. A new browser will be displayed.
After logging in, follow the prompts:
If successful, the Outlook account will appear in the Username field.
Click OK.