Repository navigation
Description
Description
Our users work with several Stalwart shared/group accounts (isPersonal: false, e.g. info@ and muhasebe@). The AI Assistant (2.2.1, marketplace) only works with the user's primary account:
- Mail search only searches the primary account. Asked about a shared mailbox, it can only return matches from the user's own mail.
- Calendar lookup only lists the user's own calendar; shared accounts' calendars are never queried.
- Archive / Move on a message that belongs to a shared account fails with "Something went wrong" (nothing is moved — safe, but unusable).
Reading works: opening or selecting a message in a shared account and asking "summarize" is fine, because those calls pass the message's account.
Cause in the bundle (ai-assistant.js 2.2.1)
- All 5
api.email.search(...)calls pass no account, e.g.api.email.search({ ...query, limit }),api.email.search({ text: q2, limit: 5 }),api.email.search({ after: since, mailboxId: inbox.id, limit: 50 }) api.calendar.getEvents({ from, to })passes no account.api.email.archive([email.id])andapi.email.move([email.id], plan.folder.id)pass no account.- In contrast,
getThread,getAttachmentText,email.getalready useaccountArg(email.accountId), andapi.user.getAccounts()is already called.
Server side is fine (measured via JMAP with the same user's session): the session lists 7 accounts (1 personal + 6 shared), each with urn:ietf:params:jmap:mail and urn:ietf:params:jmap:calendars; Email/query and Calendar/get with the shared accountId return the expected data. Bulwark's own UI archives/moves mail in these accounts correctly.
Steps to Reproduce
- Log in as a user who is a member of a shared account (Stalwart group with ACL access).
- Ask the assistant: "List the last 3 mails in the info@… mailbox" → only the user's own account is searched.
- Ask: "What is in the shared calendar this week?" → only the user's own calendar is listed.
- Enable actions ("Ask first"), open a message inside the shared account, ask "Archive this message", click "Do it" → "Something went wrong".
Expected Behavior
- Search and calendar tools can target a given account (or all readable accounts) and label each result with its account.
- Archive/Move use the message's own account (
email.accountId) and the shared account's archive-role mailbox, like Bulwark's toolbar does. - Optional admin setting: "Lookups include shared/group accounts".
Actual Behavior
- Search/calendar: only the primary account.
- Archive/Move on a shared-account message: fails with "Something went wrong"; counters unchanged in both accounts.
Bulwark Edition
Bulwark
Bulwark Version
1.20.0 (Docker, ghcr.io/bulwarkmail/webmail:v1.20.0)
Stalwart Mail Server Version
1.0.1
Browser
Chrome / Chromium
Operating System
Windows
Screenshots / Screen Recording
No response
Relevant Logs or Error Output
UI: archive_message plan → "Something went wrong. Try again." (shared account message)
Assistant reply: "Archiving does not work in this mailbox; the message belongs to another (shared) account."Additional Context
AI backend: OpenAI-compatible (vLLM, qwen3.8-27b, tool calling on). Plugin forced on for all users.
All accounts now have an archive-role mailbox (personal archive via the assistant works fine), so the failure is only the missing accountId.
Related host-side fixes: webmail #1149 (Move menus in shared mailboxes), GHSA-8x23-qw3w-mhrx (actions by id across accounts).
Happy to test a build.
Server: Ubuntu Server 26.04, Docker 29.9.3 (client OS above = Windows 11).
Activity
bulwark-warden commentedon Nov 7, 2026
The calls you quote match the plugin source:
search_mailand the archive/move action pass no account. Passingemail.accountIdfrom the plugin won't fix it alone, though. The webmail's plugin API doesn't accept an account for these methods today:api.email.moveandapi.email.archivetake no account argument. They only accept a target folder that is not shared, and they throwopen a folder of this account first; the open list belongs to another account or severalwhen a shared folder is open (host-api-mail.ts). The comment there gives the reason: plugins name messages by bare id, and ids repeat across accounts. Making this work needs a change in bulwarkmail/webmail first.api.email.searchrefuses keys it doesn't list (readObject), andaccountIdisn't one of them. It does search a shared account when you give it themailboxIdof a shared folder (host-api-mail.ts). The assistant'ssearch_mailtool never passes amailboxId, so a fix in the plugin alone could go that way.api.calendar.getEventsreads events throughqueryAllCalendarEvents(host-api-calendar.ts). That function already loops over every account withurn:ietf:params:jmap:calendarsand tags shared events with their account (client.ts). A shared account the client has marked as access-denied is skipped before the query, and one whose query fails is logged to the console and skipped. I couldn't confirm whether v1.20.0 has the same code or why your shared calendars don't show up. AFailed to query calendar events for accountline in the browser console during a lookup would help narrow it down.webmail#1273 (closed) was about the same gap in
api.email.getfor shared accounts.Bulwark Warden is an AI assistant and can be wrong. It answers from the docs, the code and earlier issues, and links its sources.
fix: let the assistant search, mark and tag mail in team and shared m…
rathlinus commentedon Nov 20, 2026
Fixed on main in 1e9326f, in the next release.
Failed to query calendar events for accountline shows in the browser console (F12, Console tab) when you ask about the shared calendar?fix: let the assistant archive and move mail in team and shared mailb…
feat: let plugins archive and move mail of shared and team accounts b…
rathlinus commentedon Nov 24, 2026
Fixed on main in 3144598, in the next release.
dasplus-repo commentedon Nov 27, 2026
Thanks a lot! Answers from our side (Bulwark 1.22.0, Stalwart 1.0.2, AI Assistant 2.2.1 — still the latest in the directory):