# Microsoft Graph Mail Poller

**URL:** https://meta.discourse.org/t/microsoft-graph-mail-poller/268611
**Category:** Plugin
**Tags:** email
**Created:** [June 16, 2023, 11:36am UTC](https://meta.discourse.org/t/microsoft-graph-mail-poller/268611 "2023-06-16T11:36:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![acosenza](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@acosenza](https://meta.discourse.org/u/acosenza)
#### Post date: [June 16, 2023, 11:36am UTC](https://meta.discourse.org/t/microsoft-graph-mail-poller/268611/1 "2023-06-16T11:36:07Z")

</div>

| | | |
| --- | --- | --- |
| ℹ | **Summary** | A mail poller plugin to enable polling emails from mailboxes on Exchange Online |
| 🛠 | **Repository Link** | [GitHub - CERN/msgraph-poll-discourse-plugin: Discourse plugin to enable polling emails usign Microsoft Graph API · GitHub](https://github.com/CERN/msgraph-poll-discourse-plugin) |
| 📖 | **Install Guide** | [How to install plugins in Discourse](https://meta.discourse.org/t/install-plugins-in-discourse/19157) |

  

### 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](https://github.com/discourse/discourse/pull/21384) contemplates this scenario.
