1

Topic: need to add object class calEntry

==== Provide required information to help troubleshoot and get quick answer ====
- Linux/BSD distribution name and version:
- iRedMail version and backend (LDAP/MySQL):
- Any related log? Log is helpful for troubleshooting.
====
Centos 5.7, iRedMail-0.7.4 , iRedProLDAPAdmi-1.6.3

Hi Zhang,

I need to get the "calEntry" object class  in LDAP to be added automatically while creating new user.

How this can be achieved kindly advice.

Thanks,
Regards,
Mohan

2

Re: need to add object class calEntry

The LDIF data of mail accounts are generated in file libs/ldaplib/iredldif.py. For new mail user, please add them in function "ldif_mailuser". For example:

def ldif_mailuser(...):
    ...
    ldif = [
        ('objectClass', [..., 'amavisAccount', 'calEntry', ]),
        ...
    ]
    ...

Note: If object class 'calEntry' requires some attributes, please add them in ldif = [] also.

3

Re: need to add object class calEntry

Hi Zhang,

Thanks for the solution provided, I have added the calEntry in objectclass in the file you mentioned and also added the attribute, Now when I create a new user the calEntry and the attribute are getting added automatically.

Thanks,
Regards,
Mohan


ZhangHuangbin wrote:

The LDIF data of mail accounts are generated in file libs/ldaplib/iredldif.py. For new mail user, please add them in function "ldif_mailuser". For example:

def ldif_mailuser(...):
    ...
    ldif = [
        ('objectClass', [..., 'amavisAccount', 'calEntry', ]),
        ...
    ]
    ...

Note: If object class 'calEntry' requires some attributes, please add them in ldif = [] also.

4 (edited by mohan 2012-03-17 19:29:09)

Re: need to add object class calEntry

Hi Zhang,

We need the attribute value for calFBURL to get automatically added in the ldap while creating the user in iredadminProLdap control panel We need the value to be like http://mail.mydomain.com/folder/fb.php? … domain.com

Kindly advice how it can be achieved.

Thanks,
Regards,
Mohan

5

Re: need to add object class calEntry

As mentioned in my first reply, you can achieve it in "ldif = []" like below:

def ldif_mailuser(...):
    ...
    ldif = [
        ('objectClass', [..., 'amavisAccount', 'calEntry', ]),
        ...
        ('calFBURL', ['http://xxx/fb.php?u=' + mail]),
    ]
    ...

6

Re: need to add object class calEntry

Hi Zhang,

We have added in the script ('calFBURL', [http://mail.mydomain.com/xxx/fb.php?u=' +mail]), now getting added.
We have someother domains also for all other domains also it is getting added like "mai.mydomain.com/xxx/fb.php?u=username@xyz.com"  instead it should get added as mail.xyz.com/xxx/fb.php?u-username@xyz.com.

Kindly advice how this can be achieved.

Thanks,
Regards,
Mohan


ZhangHuangbin wrote:

As mentioned in my first reply, you can achieve it in "ldif = []" like below:

def ldif_mailuser(...):
    ...
    ldif = [
        ('objectClass', [..., 'amavisAccount', 'calEntry', ]),
        ...
        ('calFBURL', ['http://xxx/fb.php?u=' + mail]),
    ]
    ...

7

Re: need to add object class calEntry

        ('calFBURL', ['http://' + domain +'/fb.php?u=' + mail]),

8

Re: need to add object class calEntry

Great!
Thank you very much Zhang!
It worked as expected.

Regards,

PineMailAdmin