Skip to main content

Gmail

This connector only supports read operations.

Workspace Required

This connector is intended to retrieve emails from within an organization's Google Workspace (@mybusiness.com). Currently, there is no way to extract an individual user's emails due to an unknown issue with restricted API usage. We have an issue open with Google attempting to determine the cause of the problem

Authentication Connection

In order to retrieve emails you will need an account with the Super Admin Role, as only this role can supply the required permissions. Admin SDK Console. You will also need to create an app in the Google Cloud console.

Step 1: Enabling Google APIS

Creating your Google Project

Navigate to Google Cloud Console and sign in with your Super Admin Workspace account.

Type in the name of your project such as "Simflofy". Then click Create

New Project

Enabling APIs

Go to the following link and click select for your project from the dropdown, then click Continue.

Next, click on libraries. Then select APIs.

In the next screen, search for Gmail and select

Then, click Enable.

Enable GMail API
Step 2: Creating a Service Account
  1. Go to the APIs and Services Dashboard
  2. Click Credentials
  3. Click Create CredentialsCreate Credentials
  4. Select Service Account
  5. You will be asked you to assign roles to the account. Since we need wide-ranging access for now, we should choose Owner. This can be changed later.
Grant Access
  1. The final screen invites other users to access this service account through their own service account portals. Use as needed for your organization.
Grant User Access
  1. Click DONE. You will be taken back to the service account list for the project.
Service Account ClientId

Make note of the clientId for your service account. You will need it in the next step.

Account Email
  1. Click on the three dots under Actions, then click Manage Keys
Manage Keys
  1. Click ADD KEY then Create New Key, then select JSON
Create New Key
  1. Click Create. A JSON file will be downloaded. Save it for later.
Step 3: Domain Wide Delegation

Domain wide delegation allows a single set of credentials to act as different users within the organization, thus giving us access to their individual inboxes.

  1. Go to admin.google.com and log in as your Super Admin
  2. On the sidebar, go to Security > Access and data control > Api Controls
  3. Scroll to the bottom of the page and click MANAGE DOMAIN-WIDE DELEGATION
    1. Alternatively, you can just go here
  4. Click Add New
  5. Paste your client Id from the previous section into the text box.
  6. Add the scope https://www.googleapis.com/auth/gmail.readonly, since we only wish to read and not write.
  7. Click Authorize

Creating your JWT Auth Connector in Simflofy

  1. Go to Connections > Authentication
  2. Create a Google JWT Auth Connector
  3. Paste the content of that json file into the text box.
  4. Click Save.

Discovery Connector

Gmail does not currently support discovery


Integration Connection

This is used to store and write content alongside its metadata to Google Drive.

  • Connection Name: This is a unique name given to the connector instance upon creation.
  • Description: A description of the connector to help identify it better.
  • Authentication Connection: Your Google JWT Auth Connection

Job Configuration

  • Email addresses of users: A tag input for users in the organizations you wish to crawl
    • Each user's emails will be stored in a folder with their username. So, admin@mycompany.com, will have a folder called admin.
  • Gmail Query: By default, Simflofy performs the following query: in:inbox before:<startTime> after:<endTime>. Populating this field will completely override this query. Possible parameters can be found here
  • Only retrieve emails with these tags: Tags input for various labels in the user inboxes. Will filter on these labels even if Gmail Query is populated.
  • Format: There are three available formats:
    • EML: Base EML format. Attachments will be automatically integrated into the body of the document.
    • HTML: The body will be output in html format. Attachments, if included, will also be output under the user's folder.
    • Text: The plain text of each email will be the body of the document. Attachments, if included, will also be output under the user's folder.
  • Get Attachments: For Html and Text format. Attachments will be processed as individual documents with the type attachment.
    • Each attachment will have the metadata field attachment.messageId to associate it with its message.
  • Each thread will be given its own folder: Each email in gmail has a thread id. This option simply prepends this thread id to emails so email threads will be grouped together on output
  • Include spam and trash: These folders are not searched by default. Checking this will add them to search results.