[Outlook Email Connector] Free-text search_messages fails for personal Microsoft accounts (MSA)
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- PR merge metrics
- PR metrics pending
Description
What issue are you seeing?
The Outlook Email plugin/connector's search_messages tool fails for free-text searches when connected to a personal Microsoft account (MSA).
Example:
search_messages({"query":"pizza","size":50})
returns:
HTTPError: 400: This API is not supported for MSA accounts (no addressUrl for Microsoft.MicrosoftSearch,False). (Response: {"error":
{"code":"BadRequest","message":"This API is not supported for MSA accounts (no addressUrl for Microsoft.MicrosoftSearch,False).","innerError":{"date":"...","request-id":"...","client-request-id":"..."}}})
The connector appears to route free-text searches through Microsoft Graph's POST /search/query, which does not support Outlook message search for MSA accounts.
Codex then falls back to list_messages with filters such as contains(subject,'pizza'). That is not a suitable replacement because it only searches the subject. An attempted contains(bodyPreview,'pizza') fallback also fails because bodyPreview does not support filtering.
What steps can reproduce the bug?
- Connect the Outlook Email plugin using a personal Microsoft account.
- Ask Codex to search Outlook mail for a keyword such as
pizza. - The connector calls:
codex_apps.microsoft_outlook_email.search_messages({
"query": "pizza",
"size": 50
})
- The call returns:
HTTP 400
This API is not supported for MSA accounts
(no addressUrl for Microsoft.MicrosoftSearch,False).
- Codex may then try:
list_messages({
"filter": "contains(subject,'pizza') or contains(bodyPreview,'pizza')"
})
which fails because bodyPreview is not filterable.
A subject-only filter works, but does not provide full free-text email search.
What is the expected behavior?
For personal Microsoft accounts, search_messages should use the MSA-compatible Outlook message search endpoint:
GET /me/messages?$search="pizza"
instead of using POST /search/query.
This would allow proper server-side keyword search rather than falling back to incomplete subject-only filtering.
Additional information
The issue appears to be in the Outlook Email plugin/connector implementation rather than Microsoft Graph itself.
The current fallback is not suitable because:
- subject filtering misses keywords that only appear in the message body;
bodyPreviewcannot be used with $filter;- listing many messages and scanning them locally would only be a partial and inefficient workaround.
GET /me/messages?$search="..." works for the same personal Microsoft account in Microsoft Graph Explorer.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the Outlook Email connector's search_messages implementation and trace where free-text searches are sent to Microsoft Graph. Compare the current POST /search/query path with the documented GET /me/messages?$search="..." endpoint, then verify that personal-account searches return body and subject matches without the unsupported fallback behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100