Hi,

Is there a way to retrieve part number of an attachment using a message ID without fetching the entire message?

If I do the request

Code:
<SearchRequest limit="1" types="message" fetch="all" offset="400" xmlns="urn:zimbraMail">
  <query>has:attachment</query>
</SearchRequest>
I get the response

Code:
<SearchResponse more="1" sortBy="dateDesc" offset="400" xmlns="urn:zimbraMail">
  <m d="1211990216000" sf="1211990216000" sd="1211990216000" score="2.053642988204956" f="sa" cm="1" l="5" cid="-3324" s="60518" id="3324" rev="14797">
    <e d="bbb" a="yyy" t="f" p="bbb yyy"/>
    <e d="aaa" a="xxx" t="t"/>
    <su>Library</su>
    <fr>Library</fr>
    <mid>bla bla bla</mid>
    <mp part="TEXT" ct="multipart/mixed" s="60001">
      <mp part="1" ct="text/plain" s="7" body="1">
        <content>Library</content>
      </mp>
      <mp part="2" cd="attachment" filename="some.jar" ct="application/java-archive" s="43943"/>
    </mp>
  </m>
</SearchResponse>
I can easily get the attachment information from the above response, but when I'm trying to do the same a large folder with thousands of e-mails and attachments the response is predictably slow and causes out of memory issues.

For my purposes, I don't need the entire message just the attachments information.

I'm looking at SearchRequest method and trying to figure out query that also returns the mime part information for a request like

Request:
Code:
<SearchRequest limit="1" types="message" offset="400" xmlns="urn:zimbraMail">
  <query>has:attachment</query>
</SearchRequest>
Response:
Code:
<SearchResponse more="1" sortBy="dateDesc" offset="400" xmlns="urn:zimbraMail">
<m d="1211990216000" sf="1211990216000" score="2.053642988204956" f="sa" cm="1" l="5" cid="-3324" s="60518" id="3324" rev="14797">
    <e d="XXX" a="someone@somewhere.com" t="f" p="Someone somewhere"/>
    <su>Library</su>
    <fr>Library</fr>
GET ONLY ATTACHMENT INFO HERE
 </m>
</SearchResponse>
If there is another suggestion or another method I could use, I'd appreciate that as well.

-t