Topic: Using create_mail_user_OpenLDAP.py on iRedMail-0.7.1
Just testing with create_mail_user_OpenLDAP.py on iRedMail-0.7.1 and encounter error if I did not include the groups value in my CSV file. Below is my CSV file format
xxx.org, wong, wong, wong, , ,
when I run python create_mail_user_OpenLDAP.py user.csv, it show below error:
Traceback (most recent call last):
File "create_mail_user_OpenLDAP.py", line 207, in ?
domain, username, passwd, cn, quota, groups = re.split('\s?,\s?, entry)
ValueError: too many valuesto unpack
from the python file the example show as below. But it will prompt error as above due to an extra comma. Remove it and it work. Pls some one take note of that.
Example #2:
iredmail.org, zhang, secret_pw, Zhang Huangbin, , ,
The ldif file create from the python and sh file is some what different from the www@xxx.org...should the email property of all emails be the same or it is because www email user is an admin with more services?
# LDIF Export for mail=www@xxx.org,ou=Users,domainName=xxx.org,o=domains,dc=xxx,dc=xxx,dc=org
# Server: My LDAP Server (127.0.0.1)
# Search Scope: base
# Search Filter: (objectClass=*)
# Total Entries: 1
#
# Generated by phpLDAPadmin (http://phpldapadmin.sourceforge.net) on May 13, 2011 5:03 am
# Version: 1.2.0.5version: 1
# Entry 1: mail=www@xxx.xxx.org,ou=Users,domainName=xxx...
dn: mail=www@xxx.org,ou=Users,domainName=xxx.org,o=dom
ains,dc=xxx,dc=xxx,dc=org
accountstatus: active
cn: www
enabledservice: mail
enabledservice: internal
enabledservice: smtp
enabledservice: smtpsecured
enabledservice: pop3
enabledservice: pop3secured
enabledservice: imap
enabledservice: imapsecured
enabledservice: deliver
enabledservice: forward
enabledservice: senderbcc
enabledservice: recipientbcc
enabledservice: managesieve
enabledservice: managesievesecured
enabledservice: sieve
enabledservice: sievesecured
enabledservice: displayedInGlobalAddressBook
enabledservice: shadowaddress
givenname: www
homedirectory: /var/vmail/vmail1/xxx.org/w/ww/www/www-2011.05.12.
08.31.33/
mail: www@xxx.org
mailmessagestore: vmail1/xxx.org/w/ww/www/www-2011.05.12.08.31.33
/
mailquota: 104857600
objectclass: inetOrgPerson
objectclass: shadowAccount
objectclass: amavisAccount
objectclass: mailUser
objectclass: top
sn: www
storagebasedirectory: /var/vmail
uid: www
userpassword: {SSHA}passed
# LDIF Export for mail=lee@xxx.org,ou=Users,domainName=xxx.org,o=domains,dc=xxx=xxxp,dc=org
# Server: My LDAP Server (127.0.0.1)
# Search Scope: base
# Search Filter: (objectClass=*)
# Total Entries: 1
#
# Generated by phpLDAPadmin (http://phpldapadmin.sourceforge.net) on May 13, 2011 4:51 am
# Version: 1.2.0.5version: 1
# Entry 1: mail=lee@xxx.org,ou=Users,domainName=xxx...
dn: mail=lee@xxx.xxxp.org,ou=Users,domainName=xxx.xxx.org,o=dom
ains,dc=xxx,dc=xxx,dc=org
accountstatus: active
cn: lee
enabledservice: mail
enabledservice: pop3
enabledservice: pop3secured
enabledservice: imap
enabledservice: imapsecured
enabledservice: managesieve
enabledservice: managesievesecured
enabledservice: sieve
enabledservice: sievesecured
enabledservice: smtp
enabledservice: deliver
enabledservice: forward
enabledservice: senderbcc
enabledservice: recipientbcc
enabledservice: shadowaddress
enabledservice: displayedInGlobalAddressBook
enabledservice: internal
givenname: lee
homedirectory: /var/vmail/vmail1/xxx.org/l/le/lee/lee-2011.05.12.
10.51.20/
mail: lee@xxx.org
mailmessagestore: vmail1/xxx.org/l/le/lee/lee-2011.05.12.10.51.20
/
mailquota: 0
objectclass: inetOrgPerson
objectclass: shadowAccount
objectclass: amavisAccount
objectclass: mailUser
objectclass: top
sn: lee
storagebasedirectory: /var/vmail
uid: lee
userpassword: {SSHA}passwd
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.