SOGO with NS-AD filter contacts in addressbook by group

NethServer Version: 7.9.2009
Module: SOGo 5.2.0

Hi all,
I am wondering if there is any way to have adressbook in Sogo show only contacts belonging to a specified group - lest say “CONTACTS” :wink:

I have NS running AD services, and SOGo works well with it. Some of my users have couple account depending on place they are logging into system from. Also, there are couple of technical accounts I don’t want my users see when they want to pick the contact from addresbook. I wanted to filter it by a group but unfortunately I am not able to come up with an idea how to do this :slight_smile:
Would be grateful for any help.
Regards,

Hi @Mikey1,
welcome to the community.
I don’t know a solution for it, only idea I have, is to create a new addressbook, fill it it with your wanted contacts manually and share this addressbook.
But perhaps somebody else of the @support_team has an other idea.

Regards Michael

1 Like

Thank you. I will look into this.

This is possible but it would also affect the users that are able to login to sogo.
By default the allowed user source is defined as addressbook.

In /etc/sogo/sogo.conf edit line 64 and add the “CONTACTS” group to the filter, for example:

filter = "(objectClass='user') AND (sAMAccountType=805306368) AND (memberOf='CN=CONTACTS,CN=Users,DC=ad,DC=domain,DC=org')";

Restart sogo and test:

systemctl restart sogod

To make this change permanent you need to create a custom template otherwise your changes will be overwritten by the template system.

Create template-custom dir:

mkdir -p /etc/e-smith/templates-custom/etc/sogo/sogo.conf

Copy template fragment. This is usually not recommended because you override an existing template so future template updates are not applied anymore but in this case there’s no other way. If something is not working the cause may be the custom template so don’t forget about it.

cp /etc/e-smith/templates/etc/sogo/sogo.conf/45user_source /etc/e-smith/templates-custom/etc/sogo/sogo.conf/

Edit the filter in /etc/e-smith/templates-custom/etc/sogo/sogo.conf/45user_source line 93 as explained above.

Apply the changes:

signal-event nethserver-sogo-update

4 Likes

Thank you very much. That is waht I needed :slight_smile:

1 Like