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 10-22-2009, 03:09 PM
Loyal Member
 
Posts: 87
Default Distribution List help

So I am currently using this script to update our distribution lists:

Code:
# get all accounts and
# assume you want to remove several system accounts first
# and don't forget to SORT it first
zmprov gaa | sed /admin/d | sed /wiki/d | sed /spam./d | sed /ham./d |
sort > account.txt
# if you are search all users who belongs to specific COS,
# then uncomment these lines.
# and cos_id can be found by zmprov gc <cos_name> | grep  "zimbraId:"
# zmprov sa zimbraCOSId=<cos_id> > account.txt



# get all members of your distribution list, e.g. all@example.com
# again, SORT it first
zmprov gdl dl_all@website.com | grep "zimbraMailForwardingAddress" | cut -d' ' -f2 | sort > member.txt

# compare and get the difference
comm -2 -3 account.txt member.txt > add.txt
comm -1 -3 account.txt member.txt > del.txt

# add new member
cat add.txt |
while read line; do
  echo "add new member : $line"
  zmprov adlm dl_all@website.com $line
done

# and this is to remove
cat del.txt |
while read line; do
  echo "remove member : $line"
  zmprov rdlm dl_all@website.com $line
done
What would I need to add to this script to have it remove all accounts from the distro list that are "closed"?
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.