Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-02-2008, 10:04 AM
tsx tsx is offline
Intermediate Member
 
Posts: 16
Question Request attachments for a message

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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.