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

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 11-03-2006, 03:41 AM
Trained Alumni
 
Posts: 127
Default Expoort emails using REST api from command line

Hi

I need to export email's folders using REST api, from command line
using curl I tried the following command:

curl -u myuser:mypassoword -v http://myserver/zimbra/home/lorenzof...t/myfolder.zip

no file is saved and theverbose mode reports
* About to connect() to myserver... port 80
* Trying myserver..... * connected
* Connected to myserver (myserver) port 80
* Server auth using Basic with user 'lorenzof@seacom.it'
> GET /zimbra/home/lorenzof@seacom.it/myfolder.zip HTTP/1.1
Authorization: Basic bG9yZW56b2ZAc2VhY29tLml0OkFpc2NvbmRlbDU1Kg==
User-Agent: curl/7.12.1 (i686-redhat-linux-gnu) libcurl/7.12.1 OpenSSL/0.9.7a zlib/1.2.1.2 libidn/0.5.6
Host: myserver
Pragma: no-cache
Accept: */*

< HTTP/1.1 302 Moved Temporarily
< Server: Apache-Coyote/1.1
< Expires: ven, 10 nov 2006 11:29:20 GMT
< Cache-control: public, max-age=604800, post-check=7200, pre-check=604800
< Location: http://myserver/service/home/lorenzo...t/myfolder.zip
< Content-Length: 0
< Date: Fri, 03 Nov 2006 11:29:20 GMT
* Connection #0 to host myserver left intact
* Closing connection #0

what is wrong ?

thank you
Reply With Quote
  #2 (permalink)  
Old 11-03-2006, 09:56 AM
Intermediate Member
 
Posts: 23
Default

I believe you may need to use https://
Reply With Quote
  #3 (permalink)  
Old 11-03-2006, 10:29 AM
Zimbra Employee
 
Posts: 1,434
Default Use /service instead of /zimbra

Quote:
Originally Posted by lfasci
< HTTP/1.1 302 Moved Temporarily
< Location: http://myserver/service/home/lorenzo...t/myfolder.zip
Try using the Location: URL suggested in the 302 response and see if that works for you.
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote
  #4 (permalink)  
Old 11-03-2006, 11:11 AM
Zimbra Employee
 
Posts: 228
Default

Using /zimbra/home causes a server redirect. To follow redirects with curl you need to use -L/--location:

Code:
curl -L -u myuser:mypassoword -v http://myserver/zimbra/home/lorenzo...it/myfolder.zip
Though you could also just use /home (I forget which version it was added in), as it doesn't do a redirect:

Code:
curl -L -u myuser:mypassoword -v http://myserver/home/lorenzo...it/myfolder.zip
I actually meant to get back to /zimbra/home/ and fix it so it didn't do a redirect, but haven't gotten to it.
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
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.