Ok, found a solution to my problem.

My problem relied in the fact I used the mail adress as the user uid.
It seems that in a multi domain configuration, you must keep the c_uid in the form of a username (bruno), not a complete mail adress (br...@xxxxxxxx.fr). To be able to use email addresses to login, you specify LoginFieldNames.

Here is the modified part of my working conf (some of it might be overkill but it finally works :-) ):

SOGoEnableDomainBasedUID = YES;

    domains = {
        xxxxxxxxx.fr = {
        SOGoMailDomain = xxxxxxxxx.fr;
                SOGoUserSources = (
                    {
                        LoginFieldNames = ( mail );
                        canAuthenticate = YES;
                        displayName = "SOGo Users";
                        id = users_xxxxxxxxx.fr;
                        isAddressBook = NO;
                        type = sql;
                        IMAPLoginFieldName = mail;
                        IMAPHostFieldName = imaphost;
                        userPasswordAlgorithm = md5;
viewURL = "mysql://sogo:sogopasswd@127.0.0.1:3306/sogo/sogo_users";
                     }
                 );
                };
        yyyyyyyyyyyy.net = {
        SOGoMailDomain = yyyyyyyyyyyy.net;
                SOGoUserSources = (
                    {
                        LoginFieldNames = ( mail );
                        IMAPLoginFieldName = mail;
                        canAuthenticate = YES;
                        displayName = "SOGo Users";
                        id = users_yyyyyyyyyyyy.net;
                        isAddressBook = NO;
                        type = sql;
                        IMAPHostFieldName = imaphost;
                        userPasswordAlgorithm = md5;
viewURL = "mysql://sogo:sogopasswd@127.0.0.1:3306/sogo/sogo_users2";
                     }
                 );
                };
               };


Here is the mysql sogo_users database :
+-------+--------+----------------------------------+-----------------+-------------------+----------------------+
| c_uid | c_name | c_password | c_cn | mail | imaphost |
+-------+--------+----------------------------------+-----------------+-------------------+----------------------+
| admin | admin | e.....8 | Bruno Steinbach | ad...@xxxxxxxxx.fr | hosting.xxxxxxxxx.com | | bruno | bruno | e.....8 | Bruno Steinbach | br...@xxxxxxxxx.fr | hosting.xxxxxxxxx.com |
+-------+--------+----------------------------------+-----------------+-------------------+----------------------+



On 19/06/2014 14:24, Admin wrote:
Hello,

I have a fresh install of sogo on debian wheezy with authentication on
a mysql database.

I configured activesync on both android mobile and ipad, but I have to
login first on the web interface.
Without previous login on the web interface, mobile devices cannot
login and my logs show the following :

localhost.localdomain - - [19/Jun/2014:13:32:09 GMT] "POST
/SOGo/Microsoft-Server-ActiveSync?User=br...@xxxxxxxxx.fr&DeviceId=ApplDN6GLHA8DKNV&DeviceType=iPad&Cmd=Ping
HTTP/1.0" 200 13/0 5.002 - - 8K
2014-06-19 13:32:12.037 sogod[5650] ERROR(-[NSNull(misc)
forwardInvocation:]): called selector objectForKey: on NSNull !
2014-06-19 13:32:12.037 sogod[5650] ERROR(-[NSNull(misc)
forwardInvocation:]): called selector setObject:forKey: on NSNull !
2014-06-19 13:32:12.037 sogod[5650]   didn't set return value for type
'v'
2014-06-19 13:32:12.037 sogod[5650] -[WEClientCapabilities
initWithRequest:]: Unknown WebClient: user-agent='Apple-iPad2C2/1104.201'
2014-06-19 13:32:12.038 sogod[5650] ERROR(-[NSNull(misc)
forwardInvocation:]): called selector objectForKey: on NSNull !
2014-06-19 13:32:12.038 sogod[5650] ERROR(-[NSNull(misc)
forwardInvocation:]): called selector setObject:forKey: on NSNull !
2014-06-19 13:32:12.038 sogod[5650]   didn't set return value for type
'v'
Jun 19 13:32:12 sogod [5650]: [WARN] <0x0x7f2283fba620[WOContext]> Got
no user from authenticator: <SOGoDAVAuthenticator: 0x7f228416bcf0>



Here is my conf :

{
    SOGoCacheCleanupInterval = 600;
    WOWorkersCount = 20;
    OCSFolderInfoURL =
"mysql://sogo:sogopasswd@127.0.0.1:3306/sogo/sogo_folder_info";
    OCSSessionsFolderURL =
"mysql://sogo:sogopasswd@127.0.0.1:3306/sogo/sogo_sessions_folder";
    SOGoMemcachedHost = 127.0.0.1;
    SOGoAppointmentSendEMailNotifications = YES;
    SOGoFirstDayOfWeek = 1;
    SOGoLanguage = French;
    SOGoTimeZone = "Europe/Paris";
    SOGoForwardEnabled = YES;
    SOGoEnablePublicAccess = NO;
    SOGoLoginModule = Calendar;
    SOGoMailDomain = "xxxxxxxxx.fr";
    SOGoMailMessageCheck = every_minute;
    SOGoProfileURL =
"mysql://sogo:sogopasswd@127.0.0.1:3306/sogo/sogo_user_profile";
    SOGoSieveScriptsEnabled = YES;
    SOGoSieveServer = "sieve://localhost:4190";
    SOGoEnableDomainBasedUID = YES;
    SOGoEnableEMailAlarms = YES;
    OCSEMailAlarmsFolderURL =
"mysql://sogo:sogopasswd@127.0.0.1:3306/sogo/sogo_alarms_folder";
    SOGoSuperUsernames = (
        "ad...@xxxxxxxxx.fr"
    );
    SOGoTimeZone = "Europe/Amsterdam";

    domains = {
        xxxxxxxxx.fr = {
                SOGoMailDomain = xxxxxxxxx.fr;
                SOGoUserSources = (
                    {
                        canAuthenticate = YES;
                        displayName = "SOGo Users";
                        id = users_xxxxxxxxx.fr;
                        isAddressBook = NO;
                        type = sql;
                        IMAPHostFieldName = imaphost;
                        userPasswordAlgorithm = md5;
                        viewURL =
"mysql://sogo:sogopasswd@127.0.0.1:3306/sogo/sogo_users";
                     }
                 );
                };
               };
    SOGoVacationEnabled = YES;
}

Any idea ?

--
users@sogo.nu
https://inverse.ca/sogo/lists

Reply via email to