Copying distribution lists
|This article applies to the following ZCS versions.|
I manually created an "everyone" list on my 75-seat system, which required a lot of painstaking sifting through the list of users, some of whom aren't people.
Then I needed a second such list, with a couple of people removed, for weather announcements.
There's no easy way to do that on Zimbra.
So I wrote a script:
# copy a Zimbra distribution list's members to a newly created list # final version with all the test scaffolding removed # # written Wed Sep 2 10:11:00 EDT 2009 by firstname.lastname@example.org OLD=$1 NEW=$2 # if we're not user 'zimbra', fix it [ $USER = "zimbra" ] || exec su - zimbra -c "$0 $*" # create the new list, first zmprov cdl $NEW # then add all the users. zmprov gdl $OLD | grep 'zimbraMailForwardingAddress' | sed -e "s/zim.*ess:/adlm $NEW /" | zmprov
This works ok on my 5.0.18 system; YMMV. Hat tip to elgato for the push in the right direction. Great! Works a treat in 7.2.0