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

Topic: Issue creating users

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- 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.
====

Hello,
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?
Thanks.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Issue creating users

Hello
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 ?

3

Re: Issue creating users

hi @ggaitan,

Your change is correct.