SOGo login only email address

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

just an example, you move only the file that you need to modify

do rm -rf /etc/e-smith/templates-custom/etc/sogo/sogo.conf

then follow up

wait the example is not good. Let me some time to test it in real condition, except if someone beat me first

Of course. I think the problem is caused by the SOGo version, at least I think so…
Thank you very much for your help.

You should read about Templates — NethServer 7 documentation

the issue is not relevant from the SOGo version

@stephdl
Thanks for your advice, I will look into it, but unfortunately I have a more serious problem right now.

Wish you best luck.

Thank you for the well wish, it arrived. I was lucky…

Solution:
mkdir -p /etc/e-smith/templates-custom//etc/sogo/sogo.conf/
cp /etc/e-smith/templates/etc/sogo/sogo.conf/* /etc/e-smith/templates-custom/etc/sogo/sogo.conf/

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

} elsif($sssd->isAD){
# user source: AD
$bindPassword =~ s/"/"/;

   $OUT .= <<EOF 

/* 45 AD authentication */
SOGoUserSources =(
{
id = AD_Users;
type = ldap;
CNFieldName = cn;
IDFieldName = $CustomEmailField;
UIDFieldName = sAMAccountName;
IMAPLoginFieldName = $CustomEmailField;
canAuthenticate = YES;
bindDN = “$bindDN”;
bindPassword = “$bindPassword”;
baseDN = “$userDN”;
bindFields = $CustomEmailField;
hostname = $ldapURI;
filter = “(objectClass=‘user’) AND (sAMAccountType=805306368)”;
MailFieldNames = ("$CustomEmailField");
scope = SUB;
displayName = “$DomainName users”;
isAddressBook = YES;
},

vi /etc/e-smith/templates-custom/etc/sogo/sogo.conf/50webinterface
/* 50 Web Interface */
SOGoVacationEnabled = YES;
SOGoForwardEnabled = YES;
SOGoSieveScriptsEnabled = YES;
SOGoMailAuxiliaryUserAccountsEnabled = {$sogod{‘MailAuxiliaryUserAccountsEnabled’} || “YES”};
SOGoMailCustomFromEnabled = YES;
SOGoForceIMAPLoginWithEmail = YES;
//SOGoFirstDayOfWeek = 1;
//SOGoMailReplyPlacement = “above”;
//SOGoMailSignaturePlacement = “above”;

signal-event nethserver-sogo-update

Important!
After elsif, you need to change id = AD_Users according to the highlighted lines.
Do not use the SOGoForceIExternalLoginWithEmail option, instead add the SOGoForceIMAPLoginWithEmail option in the 50webinterface file according to the highlighted line.

Can someone confirm that he also manages to set it up?

2 Likes

waves…we could imagine to make it up inside the module. Sorry but for now I am busy on NS8

No worries. I was able to solve my current problem. The rest will happen…

1 Like