1

Topic: Adding new attributes to OpenLDAP

==== Required information ====
- iRedMail version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Linux/BSD distribution name and version:
- Related log if you're reporting an issue:
====

Can anyone assist me on how to add a new attribute to existing OpenLDAP schema? I need to my own attribute which are require in registering users.

2

Re: Adding new attributes to OpenLDAP

https://IP_iredmail/ldap/
cn=Manager,dc=domain,dc=ltd
******
and... adding

3

Re: Adding new attributes to OpenLDAP

Dear Hoper, What do you mean?

4

Re: Adding new attributes to OpenLDAP

Do you need a new attribute name, or just want a attribute/value pair? If you need a new attribute name, you have to add your own LDAP schema file and include it in OpenLDAP config file (slapd.conf).

Just curious, may i know what attribute (and value) you want to add? Maybe we can help solve it in a better way.

5

Re: Adding new attributes to OpenLDAP

I need to add new attribute like vote number (string value) and check number (numeric value) for my users.

6

Re: Adding new attributes to OpenLDAP

djbahati1 wrote:

I need to add new attribute like vote number (string value) and check number (numeric value) for my users.

There're at least two methods to achieve your requirement:

1) Add new attribute names in OpenLDAP schema file, for example, iredmail.schema, with proper value format. But it's better to write your own schema file instead of appending them in schema files provided by other applications.
2) Store them in a SQL database.

LDAP is better to store frequently read data, not the best solution to store data which will be modified frequently. But SQL database is good at storing data which will be modified/updated frequently.

PERSONALLY, i suggest you choose solution #2.

7

Re: Adding new attributes to OpenLDAP

Can you share the howto link for the said, i have researched for the solution with no luck. Thanks.

8

Re: Adding new attributes to OpenLDAP

Do I need OID?

9

Re: Adding new attributes to OpenLDAP

*) OID is not required for internal use, you can use a random OID. But if you're a service provider, it's BETTER to request one.
*) I don't have references for you right now, but i believe you can find out some with Google, that's how i got it done.

Personally, i think create your own LDAP schema file is really simple, you can copy from the ones shipped by OpenLDAP, then change the attribute names, but you need to make sure the value type (EQUALITY, SYNTAX) is what you need. I suggest you start with copy-paste-rename process.

Also, i suggest you give the second solution in my previous post a try: store them in SQL database. It's much simpler.

10

Re: Adding new attributes to OpenLDAP

Thanks, I will have a try for the suggested options