Microsoft Graph Mail Poller

: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
: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