1

Topic: Create new user python script

Hi!

I'm using the create_mail_user_OpenLDAP.py script to convert a cvs file containing all my users to be imported directly in the LDAP database.

But the created ldif file contain an entry that is not recognizable by the slapadd command.

The ldif file structure generated by the script is:

dn: mail=newemail@domain.com,ou=Users,domainName=domain.com,o
 =domains,dc=domain,dc=com
changetype: add
objectClass: inetOrgPerson
objectClass: mailUser
objectClass: shadowAccount
objectClass: amavisAccount
mail: newemail@domain.com
userPassword: newpass
mailQuota: 0
cn: User Name
sn: newemail
uid: newemail
storageBaseDirectory: /var/vmail/vmail1
mailMessageStore: vmail1/domain.com/newemail-2011.07.22.12.46.
 11/
homeDirectory: /var/vmail/vmail1/domain.com/newemail-2011.07.2
 2.12.46.11/
accountStatus: active
mtaTransport: dovecot
enabledService: mail
enabledService: smtp
enabledService: smtpsecured
...

If I try to import this file using slapadd -f .../slapd.conf -l myfile.csv.ldif

It gives me an error:

changetype attribute type undefined

If I remove this entry in all users in the ldif file the import occurs normally.

I'm just a user of LDAP I don't know if this entry is necessary or not... so I'm reporting it...

Another issue is that I disabled in the settings.py in the libs folder the date in the maildir folder, but this script doesn't have an option to disable it... I changed the script directly before generating the ldif.

Thanks.

2

Re: Create new user python script

terciof wrote:

changetype: add

As it says, just remove this line, then it should be fine. I don't think script 'create_mail_user_OpenLDAP.py' will add this.