Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-26-2009, 02:17 AM
Advanced Member
 
Posts: 192
Lightbulb Administrate primary / secondary mail accounts

As we noticed since implementing Zimbra 6 months ago, using family mailboxes ( aka secondary mailboxes, aka zimbraChildAccount ) is not very "administrator friendly". There's no way to do it from the webbased admin interface and on the cli you need to type three commands and do some copy/pasting in between. (I know, I'm lazy...). So we cooked up these three simple bash scripts to do the magic for us and thought we'd share them:

subzim: script subscribes a primary account to a secondary account
Code:
#!/bin/bash

WHO=`whoami`
if [ $WHO != "zimbra" ]
then
  echo
  echo "Execute this scipt as user zimbra (\"su - zimbra\")"
  echo
  exit 1
fi

PARAMS=2
if [ $# -ne "$PARAMS" ]
then
  echo
  echo "subzim <primary account needing access to> <this secondary account>"
  echo
  exit 1
fi  

SUBSCRIBER=$1
MAILBOX=$2
ID=`zmprov ga $MAILBOX | grep zimbraId: | awk '{print $2}'`
`zmprov ma $SUBSCRIBER +zimbraChildAccount $ID`
`zmprov ma $SUBSCRIBER +zimbraPrefChildVisibleAccount $ID`
unsubzim: unsubsribes a primary account from a secondary account
Code:
#!/bin/bash

WHO=`whoami`
if [ $WHO != "zimbra" ]
then
  echo
  echo "Execute this scipt as user zimbra (\"su - zimbra\")"
  echo
  exit 1
fi

PARAMS=2
if [ $# -ne "$PARAMS" ]
then
  echo
  echo "unsubzim <primary account> < from this secondary account>"
  echo
  exit 1
fi

SUBSCRIBER=$1
MAILBOX=$2
ID=`zmprov ga $MAILBOX | grep zimbraId: | awk '{print $2}'`
`zmprov ma $SUBSCRIBER -zimbraChildAccount $ID`
`zmprov ma $SUBSCRIBER -zimbraPrefChildVisibleAccount $ID`
sublist Lists primary accounts having access to a secondary account
Code:
#!/bin/bash

WHO=`whoami`
if [ $WHO != "zimbra" ]
then
  echo
  echo "Execute this scipt as user zimbra (\"su - zimbra\")"
  echo
  exit 1
fi

PARAMS=1
if [ $# -ne "$PARAMS" ]
then
  echo
  echo "sublist <secondary account to list subscribed primary accounts for>"
  echo
  exit 1
fi 

id=`zmprov ga $1 | grep zimbraId: | awk '{print $2}'`
list=`zmprov sa zimbraChildAccount=$id`
echo $list
Hope it's useful for you! It's been saving us lot's of work

Last edited by Hivos; 03-09-2010 at 05:49 AM..
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.