Results 1 to 5 of 5

Thread: Command line export addressbook ??????

Hybrid View

  1. #1
    Join Date
    Jun 2008
    Posts
    22
    Rep Power
    7

    Default Command line export addressbook ??????

    Hi!!!

    Where I work we have one user ( centralinist ) who share a contacts folder. This folder have many subfolders containing all public contatcts (all customers, all emplyes ecc ecc.).

    My old but very big boss don't want to use PC and I have to print addressbook for him.

    Zimbra print output isn't usefoul and I have to make a layout customized but It's no possible in zimbra.

    So I need to a batch procedure that nighly export all contacts in some format (and later import it into a database and create a with same report manager a customized report).

    Is possible to make a similar export as CSV or something similar from command line?

  2. #2
    Join Date
    May 2006
    Location
    USA
    Posts
    6,242
    Rep Power
    21

    Default

    as root or zimbra:
    /opt/zimbra/bin/zmmailbox -z -m user@domain.com getRestURL "/Contacts?fmt=csv" > /tmp/user-contacts.csv


    or via:
    Code:
    https://user@domain.com.com:thepass@srv.domain.com/zimbra/home/user@domain.com/Contacts.csv
    (with or without their password depending on how your authing; previous token, as admin, etc)

  3. #3
    Join Date
    Jun 2008
    Posts
    22
    Rep Power
    7

    Default

    Quote Originally Posted by mmorse View Post
    as root or zimbra:
    /opt/zimbra/bin/zmmailbox -z -m user@domain.com getRestURL "/Contacts?fmt=csv" > /tmp/user-contacts.csv
    It's that I need but don't work....

    I've just run it without redirection to file and reply is one empty row.

    structure is:

    Code:
    Contacts (empty) -
                      -> "Public Folder" (shared but empty) - 
                                                             -> Customers
                                                             -> Banks
                                                             -> Employed
                                                             -> ecc ecc

  4. #4
    Join Date
    May 2006
    Location
    USA
    Posts
    6,242
    Rep Power
    21

    Default

    Adjust your search a little:
    /opt/zimbra/bin/zmmailbox -z -m user@domain.com getRestURL "/?fmt=csv&query=under:Contacts" > /tmp/user-contacts.csv

    Bug 15161 - add a 'recursive' option for REST fetch

    In the below example email2@domain.com is in /Contacts/Test
    # /opt/zimbra/bin/zmmailbox -z -m user@domain.com getRestURL "/Contacts?fmt=csv"
    "email","firstName","fullName","lastName","middleN ame"
    "email@domain.com","first","first middle last","last","middle"

    vs

    # /opt/zimbra/bin/zmmailbox -z -m user@domain.com getRestURL "/?fmt=csv&query=under:Contacts"
    "email","firstName","fullName","lastName","middleN ame"
    "email2@domain.com","f2","f2 m2 l2","l2","m2"
    "email@domain.com","first","first middle last","last","middle"

  5. #5
    Join Date
    Jun 2008
    Posts
    22
    Rep Power
    7

    Default

    Ok, partially solved....

    "Public folder" was at the same level of contacts so:

    Code:
    /opt/zimbra/bin/zmmailbox -z -m user@domain.com getRestURL "/?fmt=csv&query=under:Public folder"
    but empty space between "public" and "folder" is a problem.This don't work:
    Code:
    /opt/zimbra/bin/zmmailbox -z -m user@domain.com getRestURL '/?fmt=csv&query=under:Public folder'
    as this:
    Code:
    /opt/zimbra/bin/zmmailbox -z -m user@domain.com getRestURL "/?fmt=csv&query=under:Public%20folder"
    so renaming it into "PublicFolder" I could see csv.

    there is a way to customize CSV output?
    I need to know if a row is under publicFolder/Banks, or PublicFolder/Customers ecc ecc.

Similar Threads

  1. [SOLVED] my server stopped working???
    By cecil in forum Administrators
    Replies: 4
    Last Post: 04-20-2008, 09:07 AM
  2. installation error during ldap setup
    By ljramos in forum Installation
    Replies: 23
    Last Post: 08-10-2007, 11:48 PM
  3. unable to restart zimbra after reboot
    By droefs in forum Administrators
    Replies: 28
    Last Post: 04-16-2006, 03:33 PM
  4. Replies: 16
    Last Post: 01-05-2006, 09:55 AM
  5. After Succesfull Install, Cannot Start mta
    By bsimzer in forum Installation
    Replies: 26
    Last Post: 12-16-2005, 05:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •