1

Topic: how can i exclude a mail address from globaladdress using mysqlbackend

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.2
- Linux/BSD distribution name and version: ubuntu-14.04.2
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):Mysql
- Web server (Apache or Nginx):Apache
- Manage mail accounts with iRedAdmin-Pro? No
- Related log if you're reporting an issue:
====
I use Sogo for contacts. But i want to exclude some mail addresses in global address book.
in demo with ldap backend, I see a button about that,  But how can i exclude a mail address from Sogo?

thanks

----

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

2

Re: how can i exclude a mail address from globaladdress using mysqlbackend

The button in iRedAdmin-Pro-LDAP is used for Roundcube.

With SOGo, you can try below steps:

*) With default 'SOGoUserSources' in /etc/sogo/sogo.conf, update 'isAddressBook = NO'.
*) Add additional 'SOGoUserSources' setting (you can copy existing one), then set 'canAuthenticate = NO' and 'isAddressBook = YES'. Update 'filter' setting to the one used in Roundcube. For example:

filter = "objectClass=mailUser AND accountStatus=active AND enabledService=mail AND enabledService=displayedInGlobalAddressBook";

3

Re: how can i exclude a mail address from globaladdress using mysqlbackend

I updated the sogo.conf, but it doesn't work. for example i have 10 mail addresses and i don't want to be seen boss@domain.com in global address book.  But i want all addresses to see eachother's mail addresses but the boss' mail address.

how can i do that ?

4

Re: how can i exclude a mail address from globaladdress using mysqlbackend

The point is not it doesn't work, the point is what you change in sogo.conf? show us the full sogo.conf so that others can help troubleshoot. NOTE: you should remove password or any sensitive info in this file before pasting.

5

Re: how can i exclude a mail address from globaladdress using mysqlbackend

ZhangHuangbin wrote:

The point is not it doesn't work, the point is what you change in sogo.conf? show us the full sogo.conf so that others can help troubleshoot. NOTE: you should remove password or any sensitive info in this file before pasting.

I want a certain mail address not to be seen by other users at the same domain on the global address book.

my full sogo.conf is below;
{
    WOWorkersCount = 20;
    WOPort = 127.0.0.1:20000;
    WOLogFile = /var/log/sogo/sogo.log;
    SOGoProfileURL = "mysql://sogo:PASS@127.0.0.1:3306/sogo/sogo_user_profile";
    OCSFolderInfoURL = "mysql://sogo:PASS@127.0.0.1:3306/sogo/sogo_folder_info";
    OCSSessionsFolderURL = "mysql://sogo:PASS@127.0.0.1:3306/sogo/sogo_sessions_folder";
    SOGoLanguage = English;
    SOGoLoginModule = Mail;
    SOGoForceExternalLoginWithEmail = YES;
    SOGoMailCustomFromEnabled = YES;
    SOGoEnableEMailAlarms = YES;
    OCSEMailAlarmsFolderURL = "mysql://sogo:PASS@127.0.0.1:3306/sogo/sogo_alarms_folder";
    SOGoIMAPServer = "imap://127.0.0.1:143/";
    SOGoMailingMechanism = smtp;
    SOGoSMTPServer = 127.0.0.1;
    SOGoMemcachedHost = 127.0.0.1;
    SOGoSuperUsernames = (maslak@domain.com);
    SOGoTimeZone = "Asia/Istanbul";
    SOGoFirstDayOfWeek = 1;
    SOGoRefreshViewCheck = every_5_minutes;
    SOGoMailReplyPlacement = below;
    SOGoAppointmentSendEMailNotifications = YES;
    SOGoFoldersSendEMailNotifications = YES;
    SOGoACLsSendEMailNotifications = YES;
    SOGoPasswordChangeEnabled = YES; 
    SOGoUserSources = (
        {
            type = sql;
            id = vmail_mailbox;
            viewURL = "mysql://sogo:PASS@127.0.0.1:3306/sogo/users";
            canAuthenticate = YES;
            filter = "objectClass=mailUser AND accountStatus=active AND enabledService=mail AND enabledService=displayedInGlobalAddressBook";
            userPasswordAlgorithm = md5-crypt;
            isAddressBook = YES;
            displayName = "Global Address Book";
        }
    );

6

Re: how can i exclude a mail address from globaladdress using mysqlbackend

Please read my reply: http://www.iredmail.org/forum/post40517.html#p40517

You should add additional 'SOGoUserSources = {}' block. That means you will eventually have 2 'SOGoUserSources = {}' blocks, one for user authentication only, one for address book only.

7

Re: how can i exclude a mail address from globaladdress using mysqlbackend

Ok  I added second SOGoUserSources;  but now I can not login at https://server/SOGo
how can i correct that ?

        SOGoUserSources = (
        {
            type = sql;
            id = vmail_mailbox;
            viewURL = "mysql://sogo:PASS@127.0.0.1:3306/sogo/users";
            canAuthenticate = YES;
            //filter = "objectClass=mailUser AND accountStatus=active AND enabledService=mail AND enabledService=displayedInGlobalAddressBook";
            // Default algorithm used when changing passwords.
            userPasswordAlgorithm = md5-crypt;
            // prependPasswordScheme = YES;
            // Use vmail.mailbox as global address book.
            // WARNING: This will search all user accounts, not just accounts
            // under same domain as login user.
            isAddressBook = NO;
            //displayName = "Global Address Book";
        }
    );   

    SOGoUserSources = (
        {
            type = sql;
            id = vmail_mailbox;
            viewURL = "mysql://sogo:PASS@127.0.0.1:3306/sogo/users";
            canAuthenticate = NO;
            filter = "objectClass=mailUser AND accountStatus=active AND enabledService=mail AND enabledService=displayedInGlobalAddressBook";
            // Default algorithm used when changing passwords.
            userPasswordAlgorithm = md5-crypt;
            // prependPasswordScheme = YES;
            // Use vmail.mailbox as global address book.
            // WARNING: This will search all user accounts, not just accounts
            // under same domain as login user.
            isAddressBook = YES;
            displayName = "Global Address Book";
        }
    );

8

Re: how can i exclude a mail address from globaladdress using mysqlbackend

*) Don't comment out 'filter =' in first SOGoUserSources ...
*) Check /var/log/sogo/sogo.log for more details.

9

Re: how can i exclude a mail address from globaladdress using mysqlbackend

ZhangHuangbin wrote:

*) Don't comment out 'filter =' in first SOGoUserSources ...
*) Check /var/log/sogo/sogo.log for more details.

Ok I did active that line now . and restarted sogo service. but i can not log on at https://server/SOGo

sogo.log;
Jun 29 09:20:30 sogod [38228]: SOGoRootPage Login from '10.2.28.175' for user 'maslak@domain.com' might not have worked - password policy: 65535  grace: -1  expire: -1  bound: 0

My first SOgoUsersSources;
        SOGoUserSources = (
        {
            type = sql;
            id = vmail_mailbox;
            viewURL = "mysql://sogo:PASS@127.0.0.1:3306/sogo/users";
            canAuthenticate = YES;
            filter = "objectClass=mailUser AND accountStatus=active AND enabledService=mail AND enabledService=displayedInGlobalAddressBook";
            // Default algorithm used when changing passwords.
            userPasswordAlgorithm = md5-crypt;
            // prependPasswordScheme = YES;

            // Use vmail.mailbox as global address book.
            // WARNING: This will search all user accounts, not just accounts
            // under same domain as login user.
            isAddressBook = NO;
            //displayName = "Global Address Book";
        }
    );

10

Re: how can i exclude a mail address from globaladdress using mysqlbackend

I guess I'm a little pissed off because you don't read my replies carefully, and made several mistakes.

*) don't modify other settings in first SOgoUsersSources, except isAddressBook.
*) copy original SOgoUsersSources, then set 'canAuthenticate = NO' and 'isAddressBook = YES'. Update 'filter' setting to the one used in Roundcube.

11

Re: how can i exclude a mail address from globaladdress using mysqlbackend

Hello Sir

Unfortunately, although i did as you specified, but if i set first  in SOgoUsersSources block isAddressBook is NO.
second block is set canAuthenticate = NO' and 'isAddressBook = YES'
after sogo service restarted, i can not login at sogo loginpage.

my filter for both SogoUsersSources block is the filter as below;
"objectClass=mailUser AND accountStatus=active AND enabledService=mail AND enabledService=displayedInGlobalAddressBook";

my goal is only that every mail address can see global address book except for some accounts. For example there is a mail address called boss@domain.com.
i want boss@domain.com to become invisible from global address book. That's all.

I don't know how can i rearrange  the filter.

thank you.
 

 

ZhangHuangbin wrote:

I guess I'm a little pissed off because you don't read my replies carefully, and made several mistakes.

*) don't modify other settings in first SOgoUsersSources, except isAddressBook.
*) copy original SOgoUsersSources, then set 'canAuthenticate = NO' and 'isAddressBook = YES'. Update 'filter' setting to the one used in Roundcube.

12

Re: how can i exclude a mail address from globaladdress using mysqlbackend

yavuz.maslak wrote:

my filter for both SogoUsersSources block is the filter as below;
"objectClass=mailUser AND accountStatus=active AND enabledService=mail AND enabledService=displayedInGlobalAddressBook";

Don't change 'filter' in first SOgoUsersSources.
Don't use 'AND enabledService=displayedInGlobalAddressBook' for first SOgoUsersSources which is used for authentication.

13

Re: how can i exclude a mail address from globaladdress using mysqlbackend

I apologize for my mistake, there should be only one SOGoUserSources, multiple resource are defined in one SOGoUserSources like this:

SOGoUserSources = (
    {
         # block 1
    },
    {
         # block 2
    }
);