On the command line (as the zimbra
user) you can use the commands zmprov
and zmmailbox
to access user accounts, folders (mail, contacts, calendars) and folder content.
Use
zimbra@mail:~$ zmprov help
or
zimbra@mail:~$ zmmailbox help
to see what commands are available.
As an example for accessing a user's contacts from the main contacts folder use:
zmmailbox -z -m mail@domain.com getAllContacts -f "/Contacts"
But this command does not provide csv output, so read on.
There is also a Rest API for accessing Zimbra content.
The parameter fmt
only takes the following values:
If you are using fmt=csv
you can additionally specify the csv format with the parameter csvfmt
and one of the following values:
zimbra-csv
yahoo-csv
thunderbird-csv
outlook-2000-csv
outlook-2003-csv
So the entire command could look as follows:
zmmailbox -z -m mail@domain.com -t 0 getRestURL "/Contacts?fmt=csv&csvfmt=outlook-2003-csv"
Additional information can be found here