1

Topic: Domain Admin: domains under control broken

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

Hello,

after update to iRedMail 0.9.1 / iRedAdmin 2.3.0 it's not possible anymore to mark an user as domain admin. These are my steps:

- edit user profile
- check "domain admin"
- check domain in "controlled domains"
- save

After save the checkbox "domain admin" is still checked, but no domain in "controlled domains". I checked data in LDAP directory, the "domainAdmin" entry is missing in domain object.

Regards
Christof

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Domain Admin: domains under control broken

Confirmed, it's a bug in iRedAdmin-Pro-LDAP-2.3.0. Here's patch to fix it:

diff -r 1061bbc975d2 libs/ldaplib/connUtils.py
--- a/libs/ldaplib/connUtils.py    Wed May 20 09:05:38 2015 +0800
+++ b/libs/ldaplib/connUtils.py    Wed May 20 13:06:39 2015 +0800
@@ -34,7 +34,7 @@
         if action in ['add', 'assign', 'enable']:
             for v in values:
                 try:
-                    self.conn.modify_s(dn, [(ldap.MOD_ADD, attr, v)])
+                    self.conn.modify_s(dn, [(ldap.MOD_ADD, attr, str(v))])
                 except (ldap.NO_SUCH_OBJECT, ldap.TYPE_OR_VALUE_EXISTS):
                     pass
                 except Exception, e:
@@ -42,7 +42,7 @@
         elif action in ['del', 'delete', 'remove', 'disable']:
             for v in values:
                 try:
-                    self.conn.modify_s(dn, [(ldap.MOD_DELETE, attr, v)])
+                    self.conn.modify_s(dn, [(ldap.MOD_DELETE, attr, str(v))])
                 except ldap.NO_SUCH_ATTRIBUTE:
                     pass
                 except Exception, e:

Please restart Apache or uwsgi (if you're running Nginx) service after applied patch.

3

Re: Domain Admin: domains under control broken

It works, thanks!