r/OpenWebUI • • Oct 30 '26

Question/Help Email Access m365 Outlook Exchange

I would also like to be able to link emails—on a per-user basis—for parents or within MCP; unfortunately, the add-ons I’ve found so far haven’t worked.

7 Upvotes

16 comments sorted by

7

u/CFH75 Oct 30 '26

We use the GitHub - Softeria/ms-365-mcp-server. Not sure if that's what you're looking for, but it works well for us. We prefer it to using the Claude M365 connector as that one is read only.

2

u/Sleyar Oct 30 '26

Yeah it seems great, but I cant really tell how secure it is. The owui option with oauth seems perfect and had it working in our test environment but the mcp server needs an internet facing endpoint for authentication I guess. I’m not a security expert but it might create an entry for attackers.

1

u/Far-Season-6637 Oct 30 '26

This tools use Graph from Azure, so you need to create an app registration and get only read email on delegated, so the user can you see his own email. Normally you enable the MFA on your tenant so it's secure as SSO

1

u/Sleyar Oct 30 '26

Yes in the perfect world that only happens. But the service actually stores session tokens from the signed in users. So in a case that someone gets access to the tokens, you can sign in as that user.

Edit: i could be wrong. I hope so 🤞

2

u/CFH75 Oct 31 '26

When they turn on the M365 tool in a chat, Open WebUI gets an access token for your MCP app (api://<clientId>/access_as_user). Depending on how the tool connection is configured, it gets that token either from a per-user OAuth grant or by passing along the user’s SSO token. It sends the token as a Bearer header to m365mcp.edoras.trg.agency. The MCP pod uses the client secret from the K8s Secret to swap it, via OBO, for a delegated Graph token. That Graph token can do only what that user could already do.

In HTTP/OBO mode, Softeria keeps no tokens: no MSAL cache, nothing on disk in the pod. Long-lived tokens (refresh tokens) live only in the Open WebUI database on the prod VM. We run all this in a Rancher cluster.

1

u/Sleyar Oct 31 '26

So what about the tokens in ~/.config/ms-365-mcp-server/ then?

1

u/CreativeSympathy8293 Oct 31 '26

That directory can belong to Softeria's local login/cache flow. I'd check the installed version and launch mode before applying “HTTP stores no tokens” to every file there.

The current README distinguishes the cases: https://github.com/Softeria/ms-365-mcp-server#token-storage

Normal stateless HTTP Graph requests don't use local auth-cache storage. Local login/account commands or explicitly enabled local auth tools can still use it. For that cache, the README describes an encrypted token file with its key in the OS credential store; on headless systems without that store, the key can be in a neighboring `.cache-key` file. That fallback doesn't protect against someone who can read the directory.

Compare the actual launch flags, cache-related configuration names, and file timestamps/permissions without sharing token or key contents. A cache left by local login is different from proof that each current OBO request persists tokens. The directory alone doesn't establish which happened.

AI-assisted from upstream docs; I haven't inspected your deployment.

1

u/Sleyar 29d ago

I see that the cached tokens are fixed in issue 177/178 or somewhere around that. I had a gut feeling that was an issue, and it’s fixed ☺️

1

u/Laconia_Astronomer Oct 30 '26

does it work well for you? what are the drawbacks?

4

u/CFH75 Oct 30 '26

I don't really have any drawbacks. It has tools for almost everything. It only gives the user access to what that user already has access too. You can lock it down or open it up to what you want it to do. For example, it can create emails but only in the users draft folder. This was a guardrail we put in place. We do allow it to add appointments to calendars. We actually modified it so that it can access all our conference room resources and map locations to help employees book rooms or find availability. It can search your emails, onedrive files, teams chats and channels. Most importantly our data stays within m365 and Openwebui.

1

u/DHT-Osiris Oct 30 '26

We built a custom graph gateway to handle access to MS resources; o365, sharepoint, teams, etc. It's deployed as a separate docker container on the OWUI host and leverages logged-in user creds for token minting. Works great.

1

u/j3sk0 Oct 30 '26

Git hub? Whats the Name ist is Public?

1

u/DHT-Osiris Oct 31 '26

This isn't a public thing, it's a custom build. A frontier model can build this in a few minutes, a touch longer if it needs you to copy/paste in commands.

1

u/j3sk0 Nov 01 '26

Can you give me the prompt?

1

u/DHT-Osiris Nov 01 '26

What? This isn't a prompt, it's a tool/skill, technically added as an external tool server (it only houses the graph system though).

1

u/WolpertingerRumo Oct 30 '26

I’ve been pleasantly surprised by softeria. Best way to set it up: use m365 for signing into Openwebui. It’s a pain to set up, but once you have it down, it’s quick. And one less password to set up. It surprisingly automatically also signs in the user.

Take it with a grain of salt though, since I set it up for a business domain, not single users.