Problem: Mailcounter during user-import not functional

Problem:

Mailcounter during user-import not functional

Investigation:

 'scheme': {'email': '<:umlauts><firstname>.<lastname>[COUNTER2]@<maildomain>',
            'record_uid': '<firstname><lastname><school>',
            'username': {'default': '<:umlauts><firstname>[0:4].<lastname>[0:4]<:lower>[COUNTER2]'}},

Solution:

You have to check, if the unique-mail object exists and has the propreate ucsschoolUsernameNextNumber

univention-ldapsearch -b cn=unique-email,cn=ucsschool,cn=univention,dc=schule-schein,dc=de
dn: cn=charlotte.scheinig,cn=unique-email,cn=ucsschool,cn=univention,dc=schule-schein,dc=de
objectClass: ucsschoolUsername
ucsschoolUsernameNextNumber: 2
cn: charlotte.scheinig

vs

# char.schei, unique-usernames, ucsschool, univention, schule-schein.de
dn: cn=char.schei,cn=unique-usernames,cn=ucsschool,cn=univention,dc=schule-schein,dc=de
objectClass: ucsschoolUsername
ucsschoolUsernameNextNumber: 2
cn: char.schei

You also have to check that the user is properly created, regarding the scheme, if you do it manually. Normaly the import does it, but if the user was manually created, these unique-mail oder unique-usernames entries, have also be created manually.