Results 1 to 7 of 7

Thread: [SOLVED] Automatic distribution lists management

  1. #1
    Join Date
    Dec 2005
    Posts
    150
    Rep Power
    9

    Default [SOLVED] Automatic distribution lists management

    Hi

    I've just developped a script for automatic distribution list management.

    The principle is the following: by adding the keyword "Groups:" to the "Notes" field in the user account, the script will take care of modifying the distribution lists accordingly.

    For instance, a Notes field can look like:

    > Pete works from home
    > Groups: developpers@foo.com support@foo.com

    The script will make this user a member of the 2 groups and remove him from any other group.

    By running the script from cron it is possible to update the groups as often as you want.

    To simplify the migration to this system, if the Notes field does not have a "Groups:" label, then nothing changes for that user.

    The script is written in Python and needs the package python-ldap to be able to talk with Zimbra's ldap.

    It also produces lists of all users and the groups they belong to and all groups and the members they have. For instance:

    Code:
    zmgroup -s ldap://zimbra.whm.com:389 -l cvidal@whm.com toto@whm.com
    will list the groups of the users cvidal@whm.com and toto@whm.com.

    The command:

    Code:
    zmgroup -s ldap://zimbra.whm.com:389 -l
    Will list the same info for all users. The same for groups using the '-g' flag.

    If no flags are given, the script will generate a zmprov command list to modify the groups according to what it found in the Notes fields. In this version the commands are generated in the file /tmp/updategroups.zm. If it is OK, the file can be run as the user zimbra with the line:

    Code:
    zmprov < /tmp/updategroups.zm
    To be able to access the Notes field in LDAP, the user must be a LDAP administrator. Normally this is 'zimbra'. The LDAP root password can be obtained from the file /opt/zimbra/.saveconfig/config.save. The command will look like:

    Code:
    zmgroup -s ldap://zimbra.whm.com:389 -u zimbra -p your_ldap_passwd
    Use the '--help' flag to get a full description of the available features.

    In a few days, once a few admins gave me their feedback, I will activate the '-x' flag so that the 'zmprov' command is run by this script and a log is sent to the admin. In this way it will be possible to add the command to cron.hourly or cron.daily.

    The script can be download from Fichiers WHM.

    All your feedback is very welcome.

    Carlos
    Attached Files Attached Files
    Last edited by cvidal; 10-30-2007 at 11:45 AM.

  2. #2
    Join Date
    May 2006
    Location
    USA
    Posts
    6,242
    Rep Power
    21

    Default

    Very interesting approach-good job!

  3. #3
    Join Date
    Jul 2006
    Location
    BELGIUM
    Posts
    54
    Rep Power
    9

    Default

    Thanks ! i realy needed this.

    with kind regards, Lars.

  4. #4
    Join Date
    Jun 2008
    Posts
    8
    Rep Power
    7

    Default still work

    I noticed that this post is rather old and a few ver. ago. Does it still work? Is there something better? I like the idea and would like to use it.
    Ipsa scientia potestas est

  5. #5
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    24

    Default

    Have you tried it ? If it does not work against the current releases you could always have a go at fixing it

  6. #6
    Join Date
    Jun 2008
    Posts
    8
    Rep Power
    7

    Default

    Nope does not seem to work.

    zmgroup -s server -l
    works
    zmgroup -s server -g
    works
    but
    zmgroup -s server -u zimbra -p passwd

    gives no output and writes nothing to the /tmp/updategroups.zm file.

    since i dont know python and couldnt guess when looking at the code. I guess I'm SOL.
    Ipsa scientia potestas est

  7. #7
    Join Date
    Nov 2011
    Posts
    1
    Rep Power
    3

    Default

    Hello,

    Link http://files.whitehatmail.fr/ dead and i can't use the attachement.


    Weast.

Similar Threads

  1. Nested distribution lists
    By Britt in forum Administrators
    Replies: 6
    Last Post: 05-10-2013, 04:01 AM
  2. Spamassasin / AV for distribution lists?
    By lilwong in forum Administrators
    Replies: 7
    Last Post: 06-24-2008, 11:04 PM
  3. error adding distribution lists
    By mannes in forum Administrators
    Replies: 0
    Last Post: 09-28-2007, 04:43 AM
  4. Viewing members of distribution lists
    By Laird in forum Administrators
    Replies: 2
    Last Post: 07-24-2007, 03:16 PM
  5. Distribution Lists
    By swu in forum Administrators
    Replies: 1
    Last Post: 07-12-2007, 07:08 PM

Posting Permissions

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