Microsoft Graph Mail Poller

AI-generated summary

The Microsoft Graph Mail Poller is a Discourse plugin that enables polling emails from Exchange Online mailboxes using OAuth token authentication via the Microsoft Graph API. It serves as an alternative to POP3 with basic authentication. The plugin requires an application with Mail.ReadWrite permissions and a refresh token for the mailbox. Key configuration settings include msgraph_polling_mailbox, client_id, tenant_id, and oauth2_refresh_token. It supports the reply-by-mail feature when configured with reply by mail enabled, a specific email address format, and disabling manual and POP3 polling. Installation guide and setup details are available in the repository.

:information_source: Summary A mail poller plugin to enable polling emails from mailboxes on Exchange Online
:hammer_and_wrench: Repository Link GitHub - CERN/msgraph-poll-discourse-plugin: Discourse plugin to enable polling emails usign Microsoft Graph API ยท GitHub
:open_book: Install Guide How to install plugins in Discourse

Features

This plugin adds the possibility to poll emails from a mailbox hosted on Exchange Online via OAuth token authentication. It uses the Microsoft Graph API to read the emails, and it works as an alternative to the POP3 protocol with basic authentication.

Prerequisites

  • Your Exchange Online tenant needs to have an application with Mail.ReadWrite delegated permissions.
  • You need to get a refresh token for the application with permissions to read/write mails from the mailbox you want to use.

Configuration

  • msgraph_polling_mailbox: Mailbox to poll emails from
  • msgraph_polling_client_id: Client ID of the application on the Exchange Online tenant
  • msgraph_polling_tenant_id: Exchange Online Tenant ID
  • msgraph_polling_oauth2_refresh_token: Refresh token described above
  • msgraph_polling_login_endpoint: Defaults to https://login.microsoftonline.com
  • msgraph_polling_graph_endpoint: Defaults to https://graph.microsoft.com/v1.0

The repo contains guidance on how to get the refresh token.

Use the reply-by-mail feature

This plugin also contemplates the case where users want to use the reply-by-mail feature. For such cases, you need to set the following settings:

  • reply by mail: checked
  • reply by mail address: account+%{reply_key}@example.com
  • email_in: checked
  • manual polling enabled: unchecked
  • pop3 polling enabled: unchecked

n.b.: the reason why manual polling enabled and pop3 polling enabled is not needed is because the PR contemplates this scenario.

3 Likes