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.
mail listandmail searchboth returnMessageSummary, but only the list path populates the envelope fields added in #16.#16 introduced
newMessageSummary()and routedListMessagesthrough it, so list output now carriesfrom_address,to,message_id, andin_reply_to.Search()still builds itsMessageSummaryinline (internal/imap/client.go, in the search result loop) and leaves those four fields empty, soomitemptydrops them.The practical effect: an agent that filters on
from_addressgets it frommail listbut silently not frommail search.The closed #13 had updated
Search()for exactly this, so the fix is known-good — route the search loop throughnewMessageSummary()as well.Worth checking the other
MessageSummaryproducers at the same time (ListDraftsgoes throughListMessagesso it's already covered;GetThreaduses its own type).Follow-up from the #14/#15/#16 merge round.