Skip to content

mail search returns a different JSON shape than mail list #19

Description

@bscott

mail list and mail search both return MessageSummary, but only the list path populates the envelope fields added in #16.

#16 introduced newMessageSummary() and routed ListMessages through it, so list output now carries from_address, to, message_id, and in_reply_to. Search() still builds its MessageSummary inline (internal/imap/client.go, in the search result loop) and leaves those four fields empty, so omitempty drops them.

The practical effect: an agent that filters on from_address gets it from mail list but silently not from mail search.

The closed #13 had updated Search() for exactly this, so the fix is known-good — route the search loop through newMessageSummary() as well.

Worth checking the other MessageSummary producers at the same time (ListDrafts goes through ListMessages so it's already covered; GetThread uses its own type).

Follow-up from the #14/#15/#16 merge round.

Activity

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

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