Skip to content

fix: provider, than fallback to fetcher#1314

Open
andrinoff wants to merge 2 commits into
floatpane:masterfrom
andrinoff:fix/maildir-errors
Open

fix: provider, than fallback to fetcher#1314
andrinoff wants to merge 2 commits into
floatpane:masterfrom
andrinoff:fix/maildir-errors

Conversation

@andrinoff
Copy link
Copy Markdown
Member

@andrinoff andrinoff commented May 20, 2026

What?

Uses the provider, than falls back to normal fetcher.

Why?

fetchFoldersCmd called fetcher.FetchFolders(&acc) directly. That path is IMAP-only — connectWithOptions rejects empty imap_server with "unsupported service_provider". Maildir backend has its own FetchFolders but was bypassed.

closes #1309

Signed-off-by: drew <me@andrinoff.com>
@andrinoff andrinoff requested a review from a team as a code owner May 20, 2026 20:39
Copy link
Copy Markdown
Member

@floatpanebot floatpanebot left a comment

Choose a reason for hiding this comment

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

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

  • Title: Is too long (43 characters). The PR title must be strictly under 40 characters.

@floatpanebot floatpanebot added bug Something isn't working size/S Diff: 11–50 lines labels May 20, 2026
Signed-off-by: drew <me@andrinoff.com>
Copy link
Copy Markdown
Member

@floatpanebot floatpanebot left a comment

Choose a reason for hiding this comment

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

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

  • Title: Is too long (43 characters). The PR title must be strictly under 40 characters.

@floatpanebot floatpanebot added area/daemon Daemon / RPC size/L Diff: 201–800 lines labels May 20, 2026
@andrinoff andrinoff removed the size/S Diff: 11–50 lines label May 20, 2026
@andrinoff andrinoff changed the title fix: use provider, than fallback to fetcher fix: provider, than fallback to fetcher May 20, 2026
@andrinoff
Copy link
Copy Markdown
Member Author

/build

@floatpanebot floatpanebot dismissed stale reviews from themself May 20, 2026 20:55

Formatting issues have been resolved. Thank you!

@floatpanebot
Copy link
Copy Markdown
Member

Build complete (e761338)

Warning

This is an unreviewed PR build and has not been security audited. It may contain bugs, vulnerabilities, or malicious code. Do not use for daily use. Only use for testing purposes.

OS Arch Download
Linux amd64 matcha_preview_linux_amd64.tar.gz
Linux arm64 matcha_preview_linux_arm64.tar.gz
macOS amd64 matcha_preview_darwin_amd64.tar.gz
macOS arm64 matcha_preview_darwin_arm64.tar.gz
Windows amd64 matcha_preview_windows_amd64.zip
Windows arm64 matcha_preview_windows_arm64.zip

@FromSi
Copy link
Copy Markdown
Member

FromSi commented May 21, 2026

Add Closes #1309 to description

Comment thread main.go
// mailboxFolderName resolves a TUI MailboxKind to a backend folder name.
// IMAP-specific provider quirks (Gmail's "[Gmail]/Sent Mail" etc.) are
// preserved via ServiceProvider; non-IMAP backends use logical names.
func mailboxFolderName(acc *config.Account, mailbox tui.MailboxKind) string {
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.

The comment says non-IMAP backends use logical folder names, but this mapping is driven only by ServiceProvider. If a non-IMAP account has ServiceProvider set, we can pass IMAP-specific names like [Gmail]/All Mail into JMAP/maildir providers. Should the Gmail/Outlook/iCloud mapping be gated to IMAP accounts only, and return Sent/Trash/Archive for other protocols?

The problematic part is that the new function checks ServiceProvider, but does not check Protocol.

So if an account has:

Protocol: "maildir"
ServiceProvider: "gmail"

the code may resolve:

Archive -> [Gmail]/All Mail

But for maildir it should resolve to:

Archive -> Archive

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

i honestly don't really know how else to write it. the person creating the issue does not need a provider, so it will not even go there. i'll think of it in a latter PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/daemon Daemon / RPC bug Something isn't working size/L Diff: 201–800 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: maildir account fails to fetch with "unsupported service_provider:"

3 participants