Tribal Chicken

Security. Malware Research. Digital Forensics.

Connecting ownCloud to iRedMail LDAP

I recently discovered ownCloud. So far, it’s great.

Seeing that it has the option to integrate into LDAP (via a plugin), I thought that it would be great to utilise the existing user data source that is the LDAP directory used by iRedMail (though any LDAP source would work, but your settings might be different).

After installing/configuring ownCloud (which will take you all of 5 minutes), LDAP configuration is simple – especially if it’s on the same server.

Simply log in as your admin user, then go to **menu **(top right), then apps. Enable the “LDAP users and group backend“. Once that has enabled, go back to the menu and go to admin

You should see the LDAP configuration here. Under LDAP Basic, set the following (though feel free to customise):

Host: localhost

Base DN: o=domains,dc=YOURDOMAIN,dc=YOURTLD

User DN: cn=vmailadmin,dc=YOURDOMAIN,dc=TLD

Password: vmailadmin password*

User Login Filter: mail=%uid

User List Filter: objectClass=mailUser

Group Filter: objectClass=posixGroup

*The vmailadmin password, if you don’t have it, can be found in Dovecot config file

I’m not using groups at present, so have left the group filter at default.

oc_ldap_basic

Next head over to Advanced, then Directory Settings.

Set your settings as follows:

User Display Name field: cn

Base User Tree: o=domains,dc=YOURDOMAIN,dc=TLD

User Search Attributes: mailUser

Group Display Name Field: cn

Base Group Tree: o=domains,dc=tribalchicken,dc=net

oc_ldap_advanced

Hit **Test Configuration **and hopefully it will say all good!

Once you have completed, you should (in theory) be able to log out of the admin user and login with your mail user, using the full email address!

It really is that easy.

Once you are comfortable that it’s working, you can get a bit fancier and specify attributes to limit the scope of the users who are allowed to login:

oc_basic_tc

Or set a field to grab the users quota from LDAP:

oc_quota

If you run into any problems or have questions, send me an email and I’ll try to help out.