openai / openai/codex

[Outlook Email Connector] Free-text search_messages fails for personal Microsoft accounts (MSA)

Open
#38,749 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug skills tool-calls
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?
  1. Connect the Outlook Email plugin using a personal Microsoft account.
  2. Ask Codex to search Outlook mail for a keyword such as pizza.
  3. The connector calls:
codex_apps.microsoft_outlook_email.search_messages({
  "query": "pizza",
  "size": 50
})
  1. The call returns:
HTTP 400
This API is not supported for MSA accounts
(no addressUrl for Microsoft.MicrosoftSearch,False).
  1. 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;
  • bodyPreview cannot 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.