SOGo login only email address

Nethserver 7.9.2009 final
SOGo module

Hi,
I read this topic: SOGo - How to force external login with email account?

I would need to allow users to log in to SOGo only with an email address. However, this solution cannot be solved in the case of SOGo 5.6 running on Nethserver 7.9. I can’t find any templates to modify.
Can this be solved and how?

Thanks for your help

Sorry, but does anyone have an idea for a solution?

Thanks for your help

sogo use ldap to autenticate and the ldap of NethServer accepts either user and user@domain.com.

Probably a blind shot but it could be a clue

Thanks @stephdl ,
maybe no one has addressed this in the case of the new SOGo? Unfortunately, I couldn’t find an option for this in LDAP…

Although I trusted it… It seems that I have to give it up, although it would be easier for users to handle it…

Thanks and Regards

Would you like to explain what you tried to do, it should work

all files to modify are in /etc/e-smith/templates/etc/sogo/sogo.conf/

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

then cp a file to the new direction and modify it accordingly

I created the directory /etc/e-smith/templates-custom/etc/sogo and copied the file /etc/sogo/sogo.conf.

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

I then edited /etc/e-smith/templates-custom/etc/sogo/sogo.conf.
vi /etc/e-smith/templates-custom/etc/sogo/sogo.conf

I modified the following:

/* 45 AD authentication */
SOGoUserSources =(
{
id = AD_Users;
type = ldap;
CNFieldName = cn;

  •    IDFieldName = mail;
    
  •    UIDFieldName = uid;
    
  •    IMAPLoginFieldName = uid;
      canAuthenticate = YES;
      bindDN = "ldapservice@AD.DI*******.EU";
      bindPassword = "**********************";
      baseDN = "dc=ad,dc=di*******,dc=eu";
    
  •    bindFields = (mail);
    

And I added the following line:

/* 50 Web Interface */
SOGoVacationEnabled = YES;
SOGoForwardEnabled = YES;
SOGoSieveScriptsEnabled = YES;
SOGoMailAuxiliaryUserAccountsEnabled = YES;
SOGoMailCustomFromEnabled = YES;

  • SOGoForceExternalLoginWithEmail = YES;

However, you can still log in with your username or email address…

Should anything else be changed?

Thanks and Regards

Did u expand the templates ?

signal-event nethserver-sogo-update

Of course, I ran the

signal-event nethserver-sogo-update

command, in fact an update arrived for the Nethserver and I restarted the server after the update. Nothing changed.

Could you post in a github gist the complet template file

/etc/sogo/sogo.conf

@stephdl
I am attaching my /etc/sogo/sogo.conf file:

{
/* **************** DO NOT MODIFY THIS FILE **************** *
 * 
 * Manual changes will be lost when this file is regenerated.
 *
 * Please read the developer's guide, which is available
 * at https://dev.nethesis.it/projects/nethserver/wiki/NethServer
 * original work from http://www.contribs.org/development/
 *
 * Copyright (C) 2013 Nethesis S.r.l. 
 * http://www.nethesis.it - support@nethesis.it
 * 
 * ********************************************************** */


  /* 10 Database configuration (mysql) */
    SOGoProfileURL = "mysql://sogo:***********@localhost/sogo/sogo_user_profile";
    OCSFolderInfoURL = "mysql://sogo:***********@localhost/sogo/sogo_folder_info";
    OCSSessionsFolderURL = "mysql://sogo:*************@localhost/sogo/sogo_sessions_folder"; 
    OCSEMailAlarmsFolderURL = "mysql://sogo:***************@localhost/sogo/sogo_alarms_folder";


  /* 20 Mail */
    SOGoDraftsFolderName = "Drafts";
    SOGoSentFolderName = "Sent";
    SOGoTrashFolderName = "Trash";
    SOGoJunkFolderName = "Junk";
    SOGoIMAPServer = "localhost";
    SOGoSieveServer = "sieve://localhost:4190";
    SOGoSMTPServer = "127.0.0.1:10587";
    SOGoMailDomain = "**********.eu";
    SOGoSMTPAuthenticationType = "PLAIN";
    SOGoMailingMechanism = "smtp";
    NGImap4ConnectionStringSeparator = "/";

  /* 30 Notifications */
    SOGoFoldersSendEMailNotifications = NO;
    SOGoACLsSendEMailNotifications = NO;
    SOGoAppointmentSendEMailNotifications = YES;
    SOGoEnableEMailAlarms = YES;


  /* 40 Authentication */
  //SOGoPasswordChangeEnabled = YES;

  /* 45 AD authentication */
    SOGoUserSources =(
     { 
        id = AD_Users;
        type = ldap;
        CNFieldName = cn;
        IDFieldName = sAMAccountName;
        UIDFieldName = sAMAccountName;
        IMAPLoginFieldName = userPrincipalName;
        canAuthenticate = YES;
        bindDN = "ldapservice@AD.********.EU";
        bindPassword = "*********";
        baseDN = "dc=ad,dc=**********,dc=eu";
        bindFields = (
                sAMAccountName,
                userPrincipalName
            );
        hostname = ldaps://nsdc-nethserver.ad.**********.eu;
        filter = "(objectClass='user') AND (sAMAccountType=805306368)";
        MailFieldNames = ("userPrincipalName");
        scope = SUB;
        displayName = "**********.eu users";
        isAddressBook = YES;
     },
     {
        id = AD_Groups;
        type = ldap;
        CNFieldName = name;
        IDFieldName = sAMAccountName;
        UIDFieldName = sAMAccountName;
        canAuthenticate = YES;
        bindDN = "ldapservice@AD.*******.EU";
        bindPassword = "***********";
        baseDN = "dc=ad,dc=*********,dc=eu";
        hostname = ldaps://nsdc-nethserver.ad.*********.eu;
        filter = "(objectClass='group') AND (sAMAccountType=268435456)";
        MailFieldNames = ("mail");
        scope = SUB;
        displayName = "*********.eu groups";
        isAddressBook = YES;
     }
    );
 

  /* 50 Web Interface */
    SOGoVacationEnabled = YES;
    SOGoForwardEnabled = YES;
    SOGoSieveScriptsEnabled = YES;
    SOGoMailAuxiliaryUserAccountsEnabled = YES;
    SOGoMailCustomFromEnabled = YES;
  //SOGoFirstDayOfWeek = 1;
  //SOGoMailReplyPlacement = "above";
  //SOGoMailSignaturePlacement = "above";

  /* 60 General */
    SOGoTimeZone = Europe/Budapest;
    SOGoSuperUsernames = (admin); // This is an array - keep the parens!
    SOGoMemcachedHost = "127.0.0.1";
    SxVMemLimit = 512;
    SOGoEnablePublicAccess = YES;

  /* From Nethesis GNUStep configuration
     Undocumented in sogo instalation manual */
     SOGoAppointmentSendEMailReceipts = YES;

  /* 70 Active Sync options and tuning */
    SOGoMaximumPingInterval = 3540;
    SOGoMaximumSyncInterval = 3540;
    SOGoInternalSyncInterval = 30;
    SOGoMaximumSyncResponseSize = 2048;
    SOGoMaximumSyncWindowSize = 100;

    WOWatchDogRequestTimeout = 60;
    WOWorkersCount = 10;

  /* 75 enable cal- and carddav */
    SOGoAddressBookDAVAccessEnabled = YES;
    SOGoCalendarDAVAccessEnabled = YES;


  /* 80 Debug */
  //SOGoDebugRequests = YES;
  //SoDebugBaseURL = YES;
  //ImapDebugEnabled = YES;
  //LDAPDebugEnabled = YES;
  //PGDebugEnabled = YES;
  //MySQL4DebugEnabled = YES;
  //SOGoUIxDebugEnabled = YES;
  //WODontZipResponse = YES;
  //SOGoEASDebugEnabled = YES;
  //WOLogFile = "/var/log/sogo/sogo.log";
}

Thank you for your help.

I cannot find SOGoForceExternalLoginWithEmail = YES; in /etc/sogo/sogo.conf

for me it is normal that it doesn’t work, you missed something

what about

expand-template /etc/sogo/sogo.conf

and

grep -srni 'SOGoForceExternalLoginWithEmail' /etc/e-smith/template*

There really is something wrong.

The outputs are:

grep -srni ‘SOGoForceExternalLoginWithEmail’ /etc/e-smith/template*
/etc/e-smith/templates-custom/etc/sogo/sogo.conf:93: SOGoForceExternalLoginWithEmail = YES;

expand-template /etc/sogo/sogo.conf
ERROR in /etc/e-smith/templates-custom//etc/sogo/sogo.conf: Program fragment delivered error <<Quantifier follows nothing in regex; marked by ← HERE in m/* ← HERE **************** DO NOT MODIFY THIS FILE **************** *
*

  • Manual changes will be lost when this file is regenerated.
  • Please read the developer’s guide, which is available
  • at https:/ at /etc/e-smith/templates-custom//etc/sogo/sogo.conf line 7.>> at template line 1
    ERROR: Template processing failed for //etc/sogo/sogo.conf: 1 fragment generated errors
    at /sbin/e-smith/expand-template line 45.

Unfortunately, I don’t understand what this error message refers to…

you made a typo in your custom template

What typo?

I copied sogo.conf again but did not modify it. I ran it

expand-template /etc/sogo/sogo.conf

command and I get the same error again…

in log we trust

the computer says stop

display each new template and the path where they are

Only the sogo template is new. The path is

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

it is wrong

the template /etc/e-smith/templates/etc/sogo/sogo.conf/10example_template must be copied to /etc/e-smith/templates-custom/etc/sogo/sogo.conf/10example_template

This file does not exist.

ls /etc/e-smith/templates/etc/sogo/sogo.conf
10mysql 30notifications 45user_source 60general 75dav template-begin
20mail 40authentication 50webinterface 70activesync 80debug template-end