Topic: Create new user python script


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
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.
homeDirectory: /var/vmail/vmail1/domain.com/newemail-2011.07.2
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.



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.


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

buy me a cup of coffee