1 (edited by ggaitan 2020-07-28 11:30:21)

Topic: Issue creating users

- iRedMail version (check /etc/iredmail-release): 1.3.1 OPENLDAP edition.
- Deployed with iRedMail Easy or the downloadable installer? downloadable installer
- Linux/BSD distribution name and version: CentOS 8
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.

I have a csv file with the following info:

domain.com, user, password, name, ,

and I want to create ldif users file with create_mail_user_OpenLDAP.py script.

If I execute the command with python3, I obtain the following error:

# python3 create_mail_user_OpenLDAP.py prueba.csv
Traceback (most recent call last):
  File "create_mail_user_OpenLDAP.py", line 258, in <module>
    domain, username, passwd, cn, quota, groups = re.split(r'\s?,\s?', entry)
  File "/usr/lib64/python3.6/re.py", line 212, in split
    return _compile(pattern, flags).split(string, maxsplit)
TypeError: cannot use a string pattern on a bytes-like object

with python2 .. the script generate the prueba.csv.ldif file .. but with many userPassword fields ...

mail: user@domain.com
userPassword: {
userPassword: S
userPassword: S
userPassword: H
userPassword: A
userPassword: 5
userPassword: 1
userPassword: 2
userPassword: }
userPassword: J
userPassword: k
userPassword: E
userPassword: A
userPassword: 9
userPassword: s
userPassword: b
userPassword: e
userPassword: A
userPassword: =
mailQuota: 0

How can I fix this issue?


Re: Issue creating users

I edited the create_mail_user_OpenLDAP.py script file on line 283.

original line:         ('userPassword', generate_password_with_doveadmpw(passwd)),
new line:         ('userPassword', [generate_password_with_doveadmpw(passwd)]),

and I executed the script with python 2.7. This is ok ?


Re: Issue creating users

hi @ggaitan,

Your change is correct.


Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee