Gmail over IMAP

Use OAuth2 to authenticate IMAP and SMTP accounts. Use this if you need the IMAP proxy feature.

Click here to see other types of OAuth2 configurations or here for a tutorial.

  1. Open Google Cloud Console
  2. Create a new project
  3. Select the created project
  4. Navigate to APIs & ServicesEnabled APis and services
  5. Search for "Gmail API" and enable it
  6. Navigate to APIs & ServicesOAuth consent screen
  7. Choose your application type. "Internal" is valid only for email accounts in the same organization. "External" supports all Gmail accounts but requires extensive validation. In this tutorial, we use "Internal."
  8. Fill out the fields about the app in the "OAuth2 consent screen" form. Use the URL of your EmailEngine instance as the "Application home page."
  9. Click on Save and continue to get to the scopes form
  10. Click on Add or remove scopes and look for https://mail.google.com, add it and click Save and continue
  11. Navigate to APIs & ServicesCredentials
  12. Create new OAuth client ID
  13. Select Web application as the app type
  14. Add EmailEngine's URL as the authorized origin
  15. Use EmailEngine's URL with the /oauth path as the Authorized redirect URI
  16. Click Create to finish the application
  17. In the opened credentials screen, download credentials in JSON format
  18. Create a new Gmail OAuth2 application in EmailEngine
  19. Select the JSON file to autofill application configuration details
  20. Choose IMAP and SMTP as the base scope
  21. Click Register app to finish the process