View Single Post
  #12 (permalink)  
Old 02-28-2011, 04:54 AM
caio80 caio80 is offline
Senior Member
 
Posts: 55
Default

I had a case in which I created a workaround for this contacts group thing.

It exploits a SOAP Call called CreateContactRequest, and it's called via zmsoap command as the zimbra user. Therefore, you just need to write a bash script and run it as the zimbra user on your server.

The main command is the following (in bold the custom parts you need to change or substitute with variables if you loop):

- run as the zimbra user -
Code:
zmsoap -z -m <accountName@domainName.com> -u https://<hostname>:7071/service/admin/soap  -v CreateContactRequest/cn @l=<folderNumber> a="8:<contactGroupListName>" @n="fileAs" ../a="<contactGroupListName>" @n="nickname" ../a="<comma separated email addresses i.e. user1@example.com, user2@example.com, etc.>" @n="dlist" ../a="group" @n="type"
The folder number (should be 7 for Contacts root folder, pretty much 90% of the time it'll be ok) is obtainable via
Code:
zmmailbox -z -m <userName@domainName.com> gaf

In my lab for example, the following will create a list called "UsersList" inside account user@example.com with two emails as recipients ("user3@example.com, user4@example.com" in the root folder of your contacts section:

zmsoap -z -m user@example.com -u https://robert-vm.domain.com:7071/service/admin/soap -v CreateContactRequest/cn @l=7 a="8:UsersList" @n="fileAs" ../a="UsersList" @n="nickname" ../a="user3@example.com, user4@example.com" @n="dlist" ../a="group" @n="type"

According to your scenario, you now just need to harvest the comma separated list from your existing users on the old mail server, and feed into the above.
Reply With Quote