57 58 You can install it like this: 59 60 - On RHEL/CentOS 5.x: 61 62 $ sudo yum install python-ldap 63 64 - On Debian & Ubuntu: 65 66 $ sudo apt-get install python-ldap 67 ''' 68 sys. 37 # Example: 38 # domain: domain.ltd, 39 # user: zhang 40 # 41 # - hashed: d/do/domain.ltd/z/zh/zha/zhang/ 42 # - normal: domain.ltd/zhang/ 43 HASHED_MAILDIR = True 44 # - 45 46 import os 47 import sys 48 import time 49 import re 50 51 try : 52 import ldap 53 import ldif 54 except ImportError : 55 print ''' 56 Error: You don ' t have python-ldap installed, Please install it first. split ( ' / ' ) 35 36 # Hashed maildir: True, False. 33 STORAGE_BASE_DIRECTORY = ' /var/vmail/vmail1 ' 34 STORAGE_NODE = STORAGE_BASE_DIRECTORY. 29 #BINDDN = 'cn=Manager,dc=iredmail,dc=org' 30 #BINDPW = 'passwd' 31 32 # Storage base directory. 26 BASEDN = ' o=domains,dc=iredmail,dc=org ' 27 28 # LDAP bind dn & password. ![]() users.csv, and then 15 # import users listed in the file: 16 # 17 # $ python create_mail_user_OpenLDAP.py users.csv 18 # 19 # - 20 21 # - SETTINGS - 22 # LDAP server address. 11 # - 12 13 # - USAGE - 14 # Put your user list in a csv format file, e.g. 6 # Project: iRedMail () 7 8 # - WARNING - 9 # This script only works under iRedMail >= 0.4.0 due to ldap schema 10 # changes. Raw file 1 #!/usr/bin/env python 2 # encoding: utf-8 3 4 # Author: Zhang Huangbin 5 # Purpose: Add new OpenLDAP user for postfix mail server.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |