Add Office 365 shared mailbox support#2763
Open
Kevin-Hamilton wants to merge 1 commit into
Open
Conversation
Connect an O365 shared mailbox as its own account using the signed-in user's OAuth credentials, added from Preferences > Accounts > "Add Shared Mailbox..." on an existing O365 account. The button opens the onboarding window directly on a shared-address form (new o365SharedMailbox window prop), then runs the normal O365 OAuth flow with a confirmation chip showing the pending shared address. The shared address becomes the account email and IMAP XOAUTH2 identity (requires "Full Access" on the mailbox). SMTP AUTH rejects a shared address as the XOAUTH2 identity, so smtp_username stays the signed-in user, who submits mail as the shared address (requires "Send As"). Shared mailbox accounts also set two new engine-honored settings: - smtp_verification=login: the account-add test verifies the SMTP connection and credentials without transmitting checkAccount's test email — reading a shared mailbox must not require send rights, and the test email would be visible to every member of the mailbox. - create_helper_folders=false: the engine must not provision "Mailspring/Snoozed" in the shared mailbox (visible to all members); snoozing is unavailable in these accounts. Pairs with Foundry376/Mailspring-Sync#NNN, which honors smtp_username, smtp_verification, and create_helper_folders for XOAUTH2 accounts. Without that engine build, adding a shared mailbox fails at validation; existing account types are unaffected. Also: OAuthSignInPage accepts children (rendered below the provider note during sign-in), the O365 pages use tighter logo padding so the taller content stack fits the fixed-size onboarding window, and the Preferences > Accounts action buttons wrap in a flex row instead of overlapping. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the ability to connect an Office 365 shared mailbox as its own account, using the signed-in user's OAuth credentials — no separate credentials exist for shared mailboxes. This follows the pattern established by Outlook and other clients: shared mailboxes are added from account settings after your own account exists, not during first-run setup.
Pairs with Foundry376/Mailspring-Sync#116, which adds engine support for
smtp_usernameon XOAUTH2 accounts,smtp_verification: "login", andcreate_helper_folders: false. Until a mailsync build containing #116 ships, adding a shared mailbox fails at account validation (SMTP 535); all existing account types are unaffected by either PR.UX
o365SharedMailboxwindow prop), which explains the permission model: "Full Access" to read, "Send As" to send, read-only otherwise./mecannot read the shared mailbox's name) and can be edited in Preferences.How it works
The shared address becomes the account
emailAddressand therefore the IMAP XOAUTH2 identity, whilesmtp_usernamestays the signed-in user (O365's SMTP AUTH rejects shared addresses — verified on a live tenant). Two engine-honored settings avoid side effects on a mailbox other people share: the account-add test verifies SMTP credentials without transmitting the "Mailspring SMTP Test Email", and the engine skips provisioningMailspring/Snoozedin the shared mailbox (snooze is unavailable for these accounts; a follow-up could hide the snooze UI there).Incidental fixes in the same surface:
OAuthSignInPageacceptschildrenrendered below the provider note; the O365 pages use tighter logo padding so their taller content stack fits the fixed-size onboarding window; the Preferences → Accounts action buttons wrap in a flex row instead of overlapping when narrow.Testing
Verified against a live O365 tenant: shared mailbox with Full Access connects and syncs (folders, inbox); no test email is sent to the shared mailbox; no helper folder is created in it; normal O365/Gmail/IMAP onboarding unchanged.
npm run typecheckand eslint clean.🤖 Generated with Claude Code