I modified an existing script from another forum thread, which automatically mounts a shared address book to my users within a existing Distribution List. Here is the code:
When I run the above PERL script, the output from the "get distribution list information" works, however it doesn't process the zmmailbox command. It returns the following error message after trying to run it for each distribution list member:
# Get distribution list information and filter to just it's members
my $gdl = `/opt/zimbra/bin/zmprov gdl distributionlist\@domainname|grep zimbraMailForwardingAddress:`;
my @dlmembers = split('\n', $gdl);
$member =~ s/zimbraMailForwardingAddress:\s*|\s*$//g;
system ("/opt/zimbra/bin/zmmailbox -z -m $member createMountpoint --view contact -F# /sharename account@domainname /sharename");
ERROR: service.PERM_DENIED (permission denied: you do not have sufficient permissions)
- The permissions have been set appropriately on the account that the address book is being shared from. Within the web client, I can see that my distrubition list is shared and the permissions are set to 'Manager'.
- When I run the 'zmmailbox' command separately, removing $member and adding in an individual account that is a member of the distribution list, it works with no problem.
I suspect this issue is related to the PERL setup or something else related to Linux, however I am unable to figure it out.
If you have any ideas or suggestions, please reply. Thank-you in advance.