> ## Documentation Index
> Fetch the complete documentation index at: https://docs.quivr.thevibecompany.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Microsoft 365 mail

> Collect messages and attachments from a Microsoft 365 mailbox.

Sources

beta

v1.0.0

Needs Microsoft Graph app credentials

[View plugin source](https://github.com/The-Vibe-Company/quivr/tree/main/plugins/m365-mail) · Plugin ID `connector.m365_mail` · Plugin API `>=0.4.0 <0.5.0`

The mail plugin brings messages from one folder into Quivr for search and alerts.

![The Microsoft 365 mail plugin brings messages from one folder into Quivr for search and alerts.](https://mintcdn.com/thevibecompany/R_BoVln_OJmoIk9D/images/diagrams/plugin-m365-mail.png?fit=max\&auto=format\&n=R_BoVln_OJmoIk9D\&q=85\&s=564473f415775eb16d8b46fbb35f41b0)

## What it does

Collect messages and attachments from one folder in a Microsoft 365 mailbox, including a shared mailbox. Use a separate source instance for each folder you want to collect.

## Before you start

* Ask a tenant admin for the directory ID and a Microsoft Entra app registration with app-only `Mail.Read` access to the target mailbox. Follow the [Microsoft 365 setup guide](https://docs.quivr.thevibecompany.co/guides/connect-a-source.md#microsoft-365-steps) to scope access in Exchange Online.
* Get the application client ID and either a client secret or a certificate and its RSA private key. Register the public certificate on the Entra app.
* Have a collection (a Corpus in the API) and an API key with `connectors:read`, `connectors:write`, `content:read` and `search:query` for it.
* Set `credential_key` in your Quivr deployment so it can store the application credential.

## Enable it

**1. Find the mail source**

Look for `m365_mail` in `GET /v0/connector-kinds`. If it is missing, [pin the plugin](https://docs.quivr.thevibecompany.co/operate/manage-plugins.md#pin-a-plugin). Local development points to a simulated Graph API.

**2. Create an instance**

Follow [Collect from a source](https://docs.quivr.thevibecompany.co/guides/connect-a-source.md#create-an-instance) with kind `m365_mail`. Set `tenant_id` and `mailbox` in `config`. Use the mailbox's address or object ID.
In the same request, supply `client_id` with either `client_secret` or both `certificate_pem` and `private_key_pem` in `credential.secret`. [Rotate the credential](https://docs.quivr.thevibecompany.co/guides/connect-a-source.md#rotate-the-secret) before it expires.

## Use it

### Collect a mailbox folder

Leave `config.folder` unset to collect the inbox, or set it to a well-known folder name or Graph folder ID. Collection starts with mail received from the first poll by default. To include recent mail, set `config.backfill_since` to an RFC 3339 timestamp within the seven days before that poll.

After Quivr indexes the messages from a successful run, search the collection for words from a message's subject or body.

## Settings

## What it produces

Each message becomes a record with its subject, body, and details such as sender and received date. Quivr stores the original HTML body when present and keeps supported attachments with the message. The subject and body are searchable. Moving or deleting a message leaves the collected record in Quivr.

## Limits and troubleshooting

| Symptom | What to check |
| - | - |
| `mailbox_access_denied` | Verify the app has `Mail.Read` access to this mailbox with the [Exchange Online scope check](https://docs.quivr.thevibecompany.co/guides/connect-a-source.md#microsoft-365-steps). |
| `mailbox_not_found` or `folder_not_found` | Check the mailbox ID or address and the folder name or ID. |
| An attachment is missing | Check `attachments_skipped` in the message metadata. The plugin skips empty attachments, ones over 25 MiB, and links to files stored elsewhere. |

## Related plugins

[Object storage prefix](https://docs.quivr.thevibecompany.co/plugins/object-storage-prefix.md) for files delivered to a bucket.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.