Results 1 to 5 of 5

Thread: zmmailbox PERL script

Hybrid View

  1. #1
    Join Date
    Oct 2008
    Location
    Alberta
    Posts
    19
    Rep Power
    7

    Default zmmailbox PERL script

    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:

    Code:
    #!/usr/bin/perl
    # 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);
    
    foreach $member(@dlmembers){
    
        $member =~ s/zimbraMailForwardingAddress:\s*|\s*$//g;
                print "$member\n";
    
                        system ("/opt/zimbra/bin/zmmailbox -z -m $member createMountpoint --view contact -F# /sharename account@domainname /sharename");
    }
    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:

    ERROR: service.PERM_DENIED (permission denied: you do not have sufficient permissions)

    Additional Info
    - 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.

  2. #2
    Join Date
    Jul 2007
    Location
    Baltimore
    Posts
    1,649
    Rep Power
    11

    Default

    that looks more like the permissions for the shared addressbook aren't correct. have you verified that the permissions on hte addressbook include everone on the distribution list?

  3. #3
    Join Date
    Oct 2008
    Location
    Alberta
    Posts
    19
    Rep Power
    7

    Default

    Hi bdial - thank you for your reply.

    When I look in the web client at the properties of the shared address book, I see that the distribution list has 'manager' permissions (see image)

    SharePerms.jpg

    Is there something else I am missing?

  4. #4
    Join Date
    Jul 2007
    Location
    Baltimore
    Posts
    1,649
    Rep Power
    11

    Default

    have you tried doing it manually for one or two of the members to see if that works? it's definately a zimbra problem and not a perl problem. I just tried to use zmmailbox from the cli to mount my boss's inbox (i don't have permissions) and got the exact error. It could be a problem with escaping characters or something perhaps the right folder name isn't making it through and you need more quotes? Just verifying it works manually would help you get closer to the isssue

  5. #5
    Join Date
    Oct 2008
    Location
    Alberta
    Posts
    19
    Rep Power
    7

    Default

    Got it!

    Actually I was missing a backslash in the second command:

    Incorrect = /opt/zimbra/bin/zmmailbox -z -m $member createMountpoint --view contact -F# /sharename account@domainname /sharename
    Correct = /opt/zimbra/bin/zmmailbox -z -m $member createMountpoint --view contact -F# /sharename account\@domainname /sharename

    Sorry about that, it ended up being my silly mistake. Thanks for suggesting that it may have been a syntax issue, that pointed me in the right direction.

Similar Threads

  1. Replies: 0
    Last Post: 03-28-2012, 01:13 PM
  2. Replies: 4
    Last Post: 10-25-2007, 10:02 AM
  3. Replies: 1
    Last Post: 10-16-2007, 11:30 PM
  4. Replies: 1
    Last Post: 10-03-2007, 08:58 AM
  5. Perl Script Help
    By swu in forum Administrators
    Replies: 0
    Last Post: 06-18-2007, 09:46 AM

Posting Permissions

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