Skip to content

gmail search "in:spam is:unread" ignores is:unread filter — returns all spam regardless of read status #449

@TimTulsaCRS

Description

@TimTulsaCRS

When running gog gmail search with a query that combines in:spam and is:unread, the is:unread filter is ignored and all spam threads are returned (up to the API's 500-result cap).
To Reproduce
bashgog gmail search "in:spam is:unread" --account user@gmail.com --max 1000 --json | jq '.threads | length'
Returns 500 (full API cap). Expected: only unread threads.
Expected behavior
Only unread threads in spam should be returned, matching the count visible in the Gmail web UI.
Actual behavior
All spam threads are returned regardless of read status. The is:unread operator appears to be ignored when combined with in:spam.
Workarounds attempted

gog gmail messages search "in:spam is:unread" — same behavior
Post-fetch filtering via jq on labelIds | contains(["UNREAD"]) — works but requires fetching all 500 results first

Environment

Account type: personal Gmail (@gmail.com)

gog --version
v0.11.0 (91c4c15 2026-02-15T03:29:18Z)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions