Skip to content

BUG: Failed to fetch attachment from different mailbox folder via gmail. [AI Disclosure] #1689

Description

@aqeel-hashim

Describe the bug

AI Disclosure

I used opencode with openai's gpt 5.6 sol to help me diagnose this.

Installation Steps

I downloaded the latest binary (0.44.0) for linux amd64 from the github releases and ran it from .local/bin/ . The exact command I ran is:

DEBUG_IMAP=/tmp/matcha-imap.log matcha

The instructions I followed for setting gmail with matcha was from here:
Matcha Gmail Guide

Bug?

When I attempted to download an attachment from an email in the Starred mailbox folder, I kept getting the failed to fetch attachment error. I have also verified that the error comes from other folders like All Mail and Important, however it first occurred for me in the Starred folder.

Just to be clear, downloading attachments from the main INBOX folder and only the main INBOX folder works, from any other folder it gives the "Error Downloading: Could not fetch attachment error" .

According to GPT 5.6 Sol the error seems to be that matcha is attempting to download the attachment from the wrong folder and is getting an error.

NOTE:

The log file was modified by 5.6 Sol to remove any tokens, keys, and other personal information. I have included the steps the llm used to clean up the log file too. [matcha-log-cleaning]

matcha-imap-redacted.log
matcha-log-cleaning.txt

To reproduce

  1. Authenticate with oauth2 for gmail as per these instructions
  2. Go to your Starred folder in the mailbox.
  3. Open an email with an attachment (not gdrive link, just attachment)
  4. Attempt to download the attachment

Expected behavior

Attachment gets downloaded regardless of which folder in the mailbox it is from.

Screenshots

No response

System Info

Matcha version

0.44.0

Go version

No response

OS

Linux

OS version

Void Linux (GLibC) x86_64 20250202

Architecture

amd64 (x86_64)

Terminal

Ghostty

Additional context

If any additional information is needed from me, or if I missed in trying something simple please let me know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch/amd64amd64 / x86_64area/docsDocs site / READMEarea/fetcherIMAP fetch / IDLE / searcharea/oauthOAuth / XOAUTH2 / auth flowsbugSomething isn't workingdocumentationDocumentation changesneeds-triageAwaiting maintainer reviewos/linuxLinux-specificquestionFurther information requested

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions