Skip to content

fix: JMAP integration - #1445

Merged
andrinoff merged 1 commit into
floatpane:masterfrom
masukomi:jmap
Jun 5, 2026
Merged

andrinoff merged 1 commit into
floatpane:masterfrom
masukomi:jmap

Conversation

@masukomi

@masukomi masukomi commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

What?

The code to support JMAP authentication via API tokens was in place, it just wasn't wired up correctly. This fixes that.

  • JMAP protocol selection ended up getting routed to IMAP code
  • no way to specify token for account.AuthMethod
  • hasBackendProvider didn't account for/support jmap
  • modified placeholder when account.AuthMethod is token to say API Token instead of Password / App Password
  • modified tip for inputAuthMethod when protocol is jmap

Why?

Because I use Fastmail, want to use JMAP, and want to be able to read my email.

JMAP authentication with Fastmail via API Tokens wasn't working for multiple reasons. Fastmail is the largest (only?) JMAP supporting email host and they require API Tokens.

I have manually confirmed that this authenticates just fine with my Fastmail account via JMAP and the API token.

@masukomi
masukomi requested a review from a team as a code owner June 5, 2026 12:16

@floatpanebot floatpanebot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @masukomi! Please fix the following issues with your PR:

  • Title: Does not follow conventional commits (e.g., feat: added something, fix(core): resolved crash).

@floatpanebot floatpanebot added area/tui Terminal UI / view layer area/fetcher IMAP fetch / IDLE / search bug Something isn't working size/S Diff: 11–50 lines and removed bug Something isn't working labels Jun 5, 2026

@floatpanebot floatpanebot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @masukomi! Please fix the following issues with your PR:

  • Title: Does not follow conventional commits (e.g., feat: added something, fix(core): resolved crash).

@andrinoff andrinoff changed the title fixed JMAP integration fix: JMAP integration Jun 5, 2026
@floatpanebot
floatpanebot dismissed stale reviews from themself June 5, 2026 12:24

Formatting issues have been resolved. Thank you!

@floatpanebot floatpanebot added bug Something isn't working backport/v1 Merge to master and backport to release/v1 labels Jun 5, 2026
JMAP protocol accounts were being sent to IMAP code

Root cause: fetcher/dispatch.go only routed "maildir" accounts through the backend abstraction. JMAP accounts fell through to legacy IMAP code, which tried to find an IMAP server, found none, and produced the misleading "unsupported service_provider:" error. The JMAP backend was registered (imported in main.go) but never actually invoked.

Fix: Added "jmap" to the hasBackendProvider check and moved the JMAP backend import to dispatch.go (same pattern as maildir).

jmap.go wasn't supporting token auth correctly

Fastmail is the largest (only?) JMAP using email provider.
They require JMAP clients to use API tokens.

This fixes the handling of 'token' account.AuthMethod

edit account TUI now shows elements for token AuthMethod

@andrinoff andrinoff left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@andrinoff
andrinoff added this pull request to the merge queue Jun 5, 2026
Merged via the queue into floatpane:master with commit 11d4adb Jun 5, 2026
29 checks passed
@floatpanebot floatpanebot added the backported Cherry-picked onto release/v1 label Jun 5, 2026
floatpanebot pushed a commit that referenced this pull request Jun 5, 2026
## What?
The code to support JMAP authentication via API tokens was in place, it
just wasn't wired up correctly. This fixes that.

- JMAP protocol selection ended up getting routed to IMAP code
- no way to specify `token` for `account.AuthMethod`
- `hasBackendProvider` didn't account for/support `jmap`
- modified placeholder when `account.AuthMethod` is `token` to say `API
Token` instead of `Password / App Password`
- modified tip for `inputAuthMethod` when protocol is `jmap`

## Why?
Because I use Fastmail, want to use JMAP, and want to be able to read my
email.

JMAP authentication with Fastmail via API Tokens wasn't working for
multiple reasons. Fastmail is the largest (only?) JMAP supporting email
host and they require API Tokens.

I have manually confirmed that this authenticates just fine with my
Fastmail account via JMAP and the API token.

(cherry picked from commit 11d4adb)
@floatpanebot

Copy link
Copy Markdown
Member

Cherry-picked 11d4adb onto release/v1.

@floatpane floatpane deleted a comment from andrinoff Jun 5, 2026
@floatpane floatpane deleted a comment from andrinoff Jun 5, 2026
@floatpane floatpane deleted a comment from masukomi Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/fetcher IMAP fetch / IDLE / search area/tui Terminal UI / view layer backport/v1 Merge to master and backport to release/v1 backported Cherry-picked onto release/v1 bug Something isn't working size/S Diff: 11–50 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants