1

Topic: Change base dn

Hello everyone,
nice software you have created. The only problem I have is that I cannot use the mail attribute for each user dn. It would be much easier for me if I could use the cn or the uid attributes. Is there any possibility that this could be changed by me?

2

Re: Change base dn

Currently, it's hard to set another attribute as RDN. But i think you can use iRedAdmin-Pro to make life easy. check it out here:
http://iredmail.org/admin_demo.html

3

Re: Change base dn

thank you for your quick response.
The problem is that I really can't use mail for the dn, since I'm using LDAP with other software packages. I checked the test version of iRedAdminPro and there is no ability to do what I want from that panel. Thank you anyways.

What I would like to ask next is if the mail attribute is needed by iRedMail or will it be needed, anyway, by roundcube/postfix e.t.c. if installed without iRedMailOS?

4

Re: Change base dn

May i know how your other application use LDAP? Maybe i can give you some suggestion (MAYBE)

mail attributes stores email address of account, if no email address, you have to use 'uid' attribute or other attr instead, it's up to you.

5

Re: Change base dn

I'm using drupal with xmpp and other modules enabled.
In order to connect to LDAP through Drupal, I have to define the attribute that holds the username. By default, the same attribute is used for the dn creation. As a result, if I use "cn" as a username field, Drupal will create
dn: cn=username,......,dc=example,dc=com
This is something acceptable by drupal and xmpp and other modules, but, so far, I can't use this dn to login to roundcube or other services of iRedMail.

On the contrary, if I use mail attribute as username (ex. dn: mail=username@example.com,......,dc=example,dc=com) I have access to roundcube and iRedMail services, but many problems and incompatibilities with drupal and xmpp modules.
That's why I am trying to get the mail attribute out of the dn.

6

Re: Change base dn

OK, let me test the iRedAdmin-Pro-1.3.0 (will be released soon) with cn as RDN. reply here later.

7

Re: Change base dn

iRedAdmin-Pro has basic ability to use different RDN, may i know what features do you need with a admin panel? so that i can test it now and reply you.

8

Re: Change base dn

The free version of the iRedMailOS is everything I need. I just wanted to know if there was any easy way for me to use a different RDN. I'll be waiting for 1.3.0 then.

Thank you very much,
you were very cooperative
smile

9

Re: Change base dn

i improved iRedAdmin-Pro, it's now able to use other attribute as mail user RDN, but mail attribute is still required (not RDN). Currently, mail, cn, uid are supported.

If you set mail user RDN to 'cn', dn of new mail user will be something like this:

cn=Zhang Huangbin,ou=Users,domainName=iredmail.org,dc=example,dc=com

OR

uid=zhb,ou=Users,domainName=iredmail.org,dc=example,dc=com

Also, if you use other attribute as RDN, you have to change some LDAP query settings in iRedMail.

10

Re: Change base dn

Oops,forgot to mention, if what you need is just iRedMail, not iRedAdmin-Pro admin panel for account management, just change LDAP query settings in iRedMail is enough.

11

Re: Change base dn

That a was a very quick response!!! smile
You fixed the iRedAdmin-Pro version 1.3.0 or 1.2.0 or which?

12

Re: Change base dn

Ok, I downloaded iRedMail. Could you point me to the exact files I should alter?

13

Re: Change base dn

I improved iRedAdmin-Pro-1.3.0.
May i know your existing LDAP structure used for Drupal/etc? e.g.

ldap suffix: dc=example,dc=com
ou contains users: ou=Users,domainName=yourdomain.com,dc=example,dc=com

The rule is, let ldap queries query 'ou=Users', and set search scope to subtree. And it should work as expected.

I didn't test iRedMail yet, it's too late for me here. You should test it yourself. Sorry sad

Also, may i know how you manage your accounts used for iRedMail/Drupal/etc? And, How drupal perform LDAP query? Is it forced to use 'cn' as RDN? if not, i think just change Drupal is easier.

14

Re: Change base dn

Sorry, for not sending a message earlier. I followed your instructions, I did some more modification around the openldap(and other) files under the /config and /functions folders of the iRedMail and now I at least have what I need.
Drupal requests an attribute to be set for email and one for username. I can easily change the username attribute to cn or uid, but using mail as username causes many problems. For example, when I used the mail attribute as username, when trying to connect to my jabber server, it was trying to connect with:
username@example.com@jabber.example.com
instead of:
username@jabber.example.com
Drupal doesn't have a ldap tree of its own suggested. Drupal is adapted to my LDAP tree. Not the other way round.

The only problem I now have is that when trying to send e-mail trough roundcube, or other email client, it just pops-out a message with
"SMTP Error(553): Failed to add recipient username@example.com". Even when sending to gmail.com, or other e-mail services. Do you have any idea what might be going wrong?