View Issue Details

IDProjectCategoryView StatusLast Update
0003673SOGoBackend Mailpublic2016-08-05 23:20
Reporterckreutzer Assigned Tofrancis  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Platform[Server] LinuxOSDebianOS Version8 (Jessie)
Product Version3.0.2 
Target Version3.1.1Fixed in Version3.1.1 
Summary0003673: Groups "disappear" on creating message
Description

I have configured an additional UserSource for groups. It is working fine in address book (searching) and on calendar invitations (group members get expanded on saving).

When creating a new e-mail message, the group gets found (auto completion), but as soon as I select it or hit enter it disappears. Select from autocompletion works fine with resources and normal contacts.

Logs and config attached.

Steps To Reproduce
  1. Open message creation window
  2. Insert a group name to recipients and select it from autocompletion
  3. See it disappear
Additional Information

Config:

    SOGoUserSources = (
            {
                    type = ldap;
                    CNFieldName = cn;
                    IDFieldName = mail;
                    UIDFieldName = mail;
                    MailFieldNames = (mail);
                    SearchFieldNames = (displayName,cn,uid,mail,mailAlternateAddress,telephoneNumber);
                    bindFields = (uid,mail);
                    hostname = "ldap://127.0.0.1:389";
                    baseDN = "ou=People,dc=example,dc=com";
                    bindDN = "uid=mail-service,ou=Special Users,dc=example,dc=com";
                    bindPassword = "pass123";
                    canAuthenticate = YES;
                    displayName = "Addresses";
                    id = public;
                    isAddressBook = YES;
                    SOGoLDAPContactInfoAttribute = cn;
                    mapping = {
                            mozillanickname = ("nickname");
                            mozillasecondemail = ("mailAlternateAddress");
                            mozillahomestreet = ("street");
                            mozillahomelocalityname = ("l");
                            mozillahomepostalcode = ("postalCode");
                            mozillahomecountryname = ("c");
                            street = ();
                            l = ();
                            postalCode = ();
                            c = ();
                    };
                    ModulesConstraints = {
                            Mail = { objectClass = mailRecipient; };
                            ActiveSync = { objectClass = mailRecipient; };
                    };
            },
            {
                    type = ldap;
                    CNFieldName = description;
                    IDFieldName = cn;
                    UIDFieldName = cn;
                    MailFieldNames = (mail);
                    SearchFieldNames = (description,cn,mail,mailAlternateAddress);
                    filter = "(objectClass=mailGroup)";
                    hostname = "ldap://127.0.0.1:389";
                    baseDN = "ou=Groups,dc=example,dc=com";
                    bindDN = "uid=mail-service,ou=Special Users,dc=example,dc=com";
                    bindPassword = "pass123";
                    canAuthenticate = YES;
                    displayName = "Groups";
                    id = mygroups;
                    isAddressBook = YES;
                    GroupObjectClasses = (mailGroup,group);
                    SOGoLDAPContactInfoAttribute = description;
                    scope = SUB;
            },
            {
                    type = ldap;
                    CNFieldName = sn;
                    IDFieldName = cn;
                    UIDFieldName = cn;
                    MailFieldNames = (mail);
                    SearchFieldNames = (sn,cn);
                    MultipleBookingsFieldName = Multiplebookings;
                    hostname = "ldap://127.0.0.1:389";
                    baseDN = "ou=Resources,dc=example,dc=com";
                    bindDN = "uid=mail-service,ou=Special Users,dc=example,dc=com";
                    bindPassword = "pass123";
                    canAuthenticate = YES;
                    displayName = "Resources";
                    id = myresources;
                    isAddressBook = YES;
                    SOGoLDAPContactInfoAttribute = sn;
            }
    );
TagsNo tags attached.

Activities

ckreutzer

ckreutzer

2016-05-14 21:08

reporter  

system.log.txt (9,588 bytes)   
sogo.log:
May 14 22:42:24 sogod [8677]: 1.2.3.4 "GET /SOGo/so/my.user@example.com/Contacts/allContactSearch?search=netz HTTP/1.0" 200 421/0 0.013 - - 0
May 14 22:42:25 sogod [8677]: 1.2.3.4 "GET /SOGo/so/my.user@example.com/Contacts/allContactSearch?search=net HTTP/1.0" 200 733/0 0.020 2813 73% 0
May 14 22:42:29 sogod [8677]: 1.2.3.4 "GET /SOGo/so/my.user@example.com/Contacts/allContactSearch?search=net HTTP/1.0" 200 733/0 0.021 2813 73% 0
May 14 22:42:29 sogod [8677]: 1.2.3.4 "GET /SOGo/so/my.user@example.com/Contacts/mygroups/netz/view HTTP/1.0" 200 359/0 0.008 - - 0


journalctl:
Mai 14 22:42:24 myhost slapd[975]: conn=15851 fd=15 ACCEPT from IP=127.0.0.1:59458 (IP=0.0.0.0:389)
Mai 14 22:42:24 myhost slapd[975]: conn=15851 op=0 BIND dn="uid=mail-service,ou=Special Users,dc=example,dc=com" method=128
Mai 14 22:42:24 myhost slapd[975]: conn=15851 op=0 BIND dn="uid=mail-service,ou=Special Users,dc=example,dc=com" mech=SIMPLE ssf=0
Mai 14 22:42:24 myhost slapd[975]: conn=15851 op=0 RESULT tag=97 err=0 text=
Mai 14 22:42:24 myhost slapd[975]: conn=15851 op=1 SRCH base="ou=groups,dc=example,dc=com" scope=2 deref=0 filter="(&(|(description=*netz*)(cn=*netz*)(mail=*netz*)(mailAlternateAddress=*netz*))(objectClass=mailGroup))"
Mai 14 22:42:24 myhost slapd[975]: conn=15851 op=1 SRCH attr=*
Mai 14 22:42:24 myhost slapd[975]: conn=15851 op=1 SEARCH RESULT tag=101 err=0 nentries=1 text=
Mai 14 22:42:24 myhost slapd[975]: conn=15852 fd=18 ACCEPT from IP=127.0.0.1:59459 (IP=0.0.0.0:389)
Mai 14 22:42:24 myhost slapd[975]: conn=15852 op=0 BIND dn="uid=mail-service,ou=Special Users,dc=example,dc=com" method=128
Mai 14 22:42:24 myhost slapd[975]: conn=15852 op=0 BIND dn="uid=mail-service,ou=Special Users,dc=example,dc=com" mech=SIMPLE ssf=0
Mai 14 22:42:24 myhost slapd[975]: conn=15852 op=0 RESULT tag=97 err=0 text=
Mai 14 22:42:24 myhost slapd[975]: conn=15852 op=1 SRCH base="ou=resources,dc=example,dc=com" scope=2 deref=0 filter="(|(sn=*netz*)(cn=*netz*)(mail=*netz*))"
Mai 14 22:42:24 myhost slapd[975]: conn=15852 op=1 SRCH attr=*
Mai 14 22:42:24 myhost slapd[975]: conn=15852 op=1 SEARCH RESULT tag=101 err=0 nentries=0 text=
Mai 14 22:42:24 myhost slapd[975]: conn=15853 fd=19 ACCEPT from IP=127.0.0.1:59460 (IP=0.0.0.0:389)
Mai 14 22:42:24 myhost slapd[975]: conn=15853 op=0 BIND dn="uid=mail-service,ou=Special Users,dc=example,dc=com" method=128
Mai 14 22:42:24 myhost slapd[975]: conn=15853 op=0 BIND dn="uid=mail-service,ou=Special Users,dc=example,dc=com" mech=SIMPLE ssf=0
Mai 14 22:42:24 myhost slapd[975]: conn=15853 op=0 RESULT tag=97 err=0 text=
Mai 14 22:42:24 myhost slapd[975]: conn=15853 op=1 SRCH base="ou=people,dc=example,dc=com" scope=2 deref=0 filter="(|(displayName=*netz*)(cn=*netz*)(uid=*netz*)(mail=*netz*)(mailAlternateAddress=*netz*)(telephoneNumber=*netz*))"
Mai 14 22:42:24 myhost slapd[975]: conn=15853 op=1 SRCH attr=*
Mai 14 22:42:24 myhost slapd[975]: conn=15853 op=1 SEARCH RESULT tag=101 err=0 nentries=0 text=
Mai 14 22:42:24 myhost slapd[975]: conn=15851 op=2 UNBIND
Mai 14 22:42:24 myhost slapd[975]: conn=15851 fd=15 closed
Mai 14 22:42:24 myhost slapd[975]: conn=15852 op=2 UNBIND
Mai 14 22:42:24 myhost slapd[975]: conn=15852 fd=18 closed
Mai 14 22:42:24 myhost slapd[975]: conn=15853 op=2 UNBIND
Mai 14 22:42:24 myhost slapd[975]: conn=15853 fd=19 closed
Mai 14 22:42:25 myhost slapd[975]: conn=15854 fd=15 ACCEPT from IP=127.0.0.1:59463 (IP=0.0.0.0:389)
Mai 14 22:42:25 myhost slapd[975]: conn=15854 op=0 BIND dn="uid=mail-service,ou=Special Users,dc=example,dc=com" method=128
Mai 14 22:42:25 myhost slapd[975]: conn=15854 op=0 BIND dn="uid=mail-service,ou=Special Users,dc=example,dc=com" mech=SIMPLE ssf=0
Mai 14 22:42:25 myhost slapd[975]: conn=15854 op=0 RESULT tag=97 err=0 text=
Mai 14 22:42:25 myhost slapd[975]: conn=15854 op=1 SRCH base="ou=groups,dc=example,dc=com" scope=2 deref=0 filter="(&(|(description=*net*)(cn=*net*)(mail=*net*)(mailAlternateAddress=*net*))(objectClass=mailGroup))"
Mai 14 22:42:25 myhost slapd[975]: conn=15854 op=1 SRCH attr=*
Mai 14 22:42:25 myhost slapd[975]: conn=15854 op=1 SEARCH RESULT tag=101 err=0 nentries=1 text=
Mai 14 22:42:25 myhost slapd[975]: conn=15855 fd=18 ACCEPT from IP=127.0.0.1:59464 (IP=0.0.0.0:389)
Mai 14 22:42:25 myhost slapd[975]: conn=15855 op=0 BIND dn="uid=mail-service,ou=Special Users,dc=example,dc=com" method=128
Mai 14 22:42:25 myhost slapd[975]: conn=15855 op=0 BIND dn="uid=mail-service,ou=Special Users,dc=example,dc=com" mech=SIMPLE ssf=0
Mai 14 22:42:25 myhost slapd[975]: conn=15855 op=0 RESULT tag=97 err=0 text=
Mai 14 22:42:25 myhost slapd[975]: conn=15855 op=1 SRCH base="ou=resources,dc=example,dc=com" scope=2 deref=0 filter="(|(sn=*net*)(cn=*net*)(mail=*net*))"
Mai 14 22:42:25 myhost slapd[975]: conn=15855 op=1 SRCH attr=*
Mai 14 22:42:25 myhost slapd[975]: conn=15855 op=1 SEARCH RESULT tag=101 err=0 nentries=0 text=
Mai 14 22:42:25 myhost slapd[975]: conn=15856 fd=19 ACCEPT from IP=127.0.0.1:59465 (IP=0.0.0.0:389)
Mai 14 22:42:25 myhost slapd[975]: conn=15856 op=0 BIND dn="uid=mail-service,ou=Special Users,dc=example,dc=com" method=128
Mai 14 22:42:25 myhost slapd[975]: conn=15856 op=0 BIND dn="uid=mail-service,ou=Special Users,dc=example,dc=com" mech=SIMPLE ssf=0
Mai 14 22:42:25 myhost slapd[975]: conn=15856 op=0 RESULT tag=97 err=0 text=
Mai 14 22:42:25 myhost slapd[975]: conn=15856 op=1 SRCH base="ou=people,dc=example,dc=com" scope=2 deref=0 filter="(|(displayName=*net*)(cn=*net*)(uid=*net*)(mail=*net*)(mailAlternateAddress=*net*)(telephoneNumber=*net*))"
Mai 14 22:42:25 myhost slapd[975]: conn=15856 op=1 SRCH attr=*
Mai 14 22:42:25 myhost slapd[975]: conn=15856 op=1 SEARCH RESULT tag=101 err=0 nentries=6 text=
Mai 14 22:42:25 myhost slapd[975]: conn=15854 op=2 UNBIND
Mai 14 22:42:25 myhost slapd[975]: conn=15854 fd=15 closed
Mai 14 22:42:25 myhost slapd[975]: conn=15855 op=2 UNBIND
Mai 14 22:42:25 myhost slapd[975]: conn=15855 fd=18 closed
Mai 14 22:42:25 myhost slapd[975]: conn=15856 op=2 UNBIND
Mai 14 22:42:25 myhost slapd[975]: conn=15856 fd=19 closed
Mai 14 22:42:29 myhost slapd[975]: conn=15857 fd=15 ACCEPT from IP=127.0.0.1:59467 (IP=0.0.0.0:389)
Mai 14 22:42:29 myhost slapd[975]: conn=15857 op=0 BIND dn="uid=mail-service,ou=Special Users,dc=example,dc=com" method=128
Mai 14 22:42:29 myhost slapd[975]: conn=15857 op=0 BIND dn="uid=mail-service,ou=Special Users,dc=example,dc=com" mech=SIMPLE ssf=0
Mai 14 22:42:29 myhost slapd[975]: conn=15857 op=0 RESULT tag=97 err=0 text=
Mai 14 22:42:29 myhost slapd[975]: conn=15857 op=1 SRCH base="ou=groups,dc=example,dc=com" scope=2 deref=0 filter="(&(|(description=*net*)(cn=*net*)(mail=*net*)(mailAlternateAddress=*net*))(objectClass=mailGroup))"
Mai 14 22:42:29 myhost slapd[975]: conn=15857 op=1 SRCH attr=*
Mai 14 22:42:29 myhost slapd[975]: conn=15857 op=1 SEARCH RESULT tag=101 err=0 nentries=1 text=
Mai 14 22:42:29 myhost slapd[975]: conn=15858 fd=18 ACCEPT from IP=127.0.0.1:59468 (IP=0.0.0.0:389)
Mai 14 22:42:29 myhost slapd[975]: conn=15858 op=0 BIND dn="uid=mail-service,ou=Special Users,dc=example,dc=com" method=128
Mai 14 22:42:29 myhost slapd[975]: conn=15858 op=0 BIND dn="uid=mail-service,ou=Special Users,dc=example,dc=com" mech=SIMPLE ssf=0
Mai 14 22:42:29 myhost slapd[975]: conn=15858 op=0 RESULT tag=97 err=0 text=
Mai 14 22:42:29 myhost slapd[975]: conn=15858 op=1 SRCH base="ou=resources,dc=example,dc=com" scope=2 deref=0 filter="(|(sn=*net*)(cn=*net*)(mail=*net*))"
Mai 14 22:42:29 myhost slapd[975]: conn=15858 op=1 SRCH attr=*
Mai 14 22:42:29 myhost slapd[975]: conn=15858 op=1 SEARCH RESULT tag=101 err=0 nentries=0 text=
Mai 14 22:42:29 myhost slapd[975]: conn=15859 fd=19 ACCEPT from IP=127.0.0.1:59469 (IP=0.0.0.0:389)
Mai 14 22:42:29 myhost slapd[975]: conn=15859 op=0 BIND dn="uid=mail-service,ou=Special Users,dc=example,dc=com" method=128
Mai 14 22:42:29 myhost slapd[975]: conn=15859 op=0 BIND dn="uid=mail-service,ou=Special Users,dc=example,dc=com" mech=SIMPLE ssf=0
Mai 14 22:42:29 myhost slapd[975]: conn=15859 op=0 RESULT tag=97 err=0 text=
Mai 14 22:42:29 myhost slapd[975]: conn=15859 op=1 SRCH base="ou=people,dc=example,dc=com" scope=2 deref=0 filter="(|(displayName=*net*)(cn=*net*)(uid=*net*)(mail=*net*)(mailAlternateAddress=*net*)(telephoneNumber=*net*))"
Mai 14 22:42:29 myhost slapd[975]: conn=15859 op=1 SRCH attr=*
Mai 14 22:42:29 myhost slapd[975]: conn=15859 op=1 SEARCH RESULT tag=101 err=0 nentries=6 text=
Mai 14 22:42:29 myhost slapd[975]: conn=15857 op=2 UNBIND
Mai 14 22:42:29 myhost slapd[975]: conn=15857 fd=15 closed
Mai 14 22:42:29 myhost slapd[975]: conn=15858 op=2 UNBIND
Mai 14 22:42:29 myhost slapd[975]: conn=15858 fd=18 closed
Mai 14 22:42:29 myhost slapd[975]: conn=15859 op=2 UNBIND
Mai 14 22:42:29 myhost slapd[975]: conn=15859 fd=19 closed
Mai 14 22:42:29 myhost slapd[975]: conn=15860 fd=15 ACCEPT from IP=127.0.0.1:59471 (IP=0.0.0.0:389)
Mai 14 22:42:29 myhost slapd[975]: conn=15860 op=0 BIND dn="uid=mail-service,ou=Special Users,dc=example,dc=com" method=128
Mai 14 22:42:29 myhost slapd[975]: conn=15860 op=0 BIND dn="uid=mail-service,ou=Special Users,dc=example,dc=com" mech=SIMPLE ssf=0
Mai 14 22:42:29 myhost slapd[975]: conn=15860 op=0 RESULT tag=97 err=0 text=
Mai 14 22:42:29 myhost slapd[975]: conn=15860 op=1 SRCH base="ou=groups,dc=example,dc=com" scope=2 deref=0 filter="(cn=netz)"
Mai 14 22:42:29 myhost slapd[975]: conn=15860 op=1 SRCH attr=*
Mai 14 22:42:29 myhost slapd[975]: conn=15860 op=1 SEARCH RESULT tag=101 err=0 nentries=1 text=
Mai 14 22:42:29 myhost slapd[975]: conn=15860 op=2 UNBIND
Mai 14 22:42:29 myhost slapd[975]: conn=15860 fd=15 closed
system.log.txt (9,588 bytes)   
Christian Mack

Christian Mack

2016-05-19 09:39

developer   ~0010173

Are those groups of objectClass mailGroup?

ckreutzer

ckreutzer

2016-05-19 09:48

reporter   ~0010174

Yes. They at least have top, group and mailGroup.

According to these log, the entry is also found with it's objectClass of type mailGroup:
Mai 14 22:42:29 myhost slapd[975]: conn=15857 op=1 SRCH base="ou=groups,dc=example,dc=com" scope=2 deref=0 filter="(&(|(description=net)(cn=net)(mail=net)(mailAlternateAddress=net))(objectClass=mailGroup))"
Mai 14 22:42:29 myhost slapd[975]: conn=15857 op=1 SRCH attr=*
Mai 14 22:42:29 myhost slapd[975]: conn=15857 op=1 SEARCH RESULT tag=101 err=0 nentries=1 text=

It's also possible this is an error in the web interface, but I couldn't track it down. The autocompletion works and filters the correct results (see LDAP log), it even requests the correct entry from LDAP but it doesn't get added to the recipient list.

I will try to debug the HTTP requests in Chrome.

ckreutzer

ckreutzer

2016-05-19 10:59

reporter   ~0010178

What I've noticed:
When I search for contacts, a request is sent to:
/SOGo/so/my@email.com/Contacts/allContactSearch?search=<searchstring>
This behaves the same for normal contacts and for groups.

If I select a contact, it is added to recipients without further request. If I select a group, a new HTTP request is triggered and it doesn't get added:
/SOGo/so/my@email.com/Contacts/mygroups/netz/view

Possibly this is because of different contents in the search result. Both have an email, but for contacts it is c_component: vcard (search result) and for groups it is c_component: vlist. Both of them have the c_mail and emails attributes set in the JSON response. The group also has isGroup: 1.

Maybe I'll try to dig into the Angular code.

ckreutzer

ckreutzer

2016-05-19 14:14

reporter   ~0010183

So, I've digged in the frontend code:
https://github.com/inverse-inc/sogo/blob/master/UI/WebServerResources/js/Mailer/MessageEditorController.js#L212-229

That seems to be the source of all problems: When a group gets entered, this part of the code will try to split it up to it's members. The problem here: Neither the search result nor the the newly created "view" HTTP request return the "refs" attribute, where the members (and their mail addresses) should reside (at least according to that piece of code).

I'm not that fit in Objective-C, but I'll try to track it down in the backend code.

ckreutzer

ckreutzer

2016-05-20 17:26

reporter   ~0010193

Wow, thanks, that was fast!

ckreutzer

ckreutzer

2016-06-11 17:14

reporter   ~0010348

Sorry, it seems this is not yet fixed :(
Just upgraded to 3.1.2, having the same behavior as on 3.1.0. I'll try to debug it in the browser.

ckreutzer

ckreutzer

2016-06-11 18:32

reporter   ~0010349

Found it:
https://github.com/inverse-inc/sogo/blob/master/UI/WebServerResources/js/Contacts/Card.service.js#L348

This should be [...]this.isGroup);
Needed some rounds with the Chrome debugger until I've seen it :D

ludovic

ludovic

2016-08-05 23:20

administrator   ~0010586

Should be fixed in 3.1.4.

Related Changesets

sogo: master cc283575

2016-05-19 16:34

francis


Details Diff
(js) Fix autocompletion of LDAP-based groups

Fixes 0003673
Affected Issues
0003673
mod - NEWS Diff File
mod - UI/WebServerResources/js/Contacts/AddressBookController.js Diff File
mod - UI/WebServerResources/js/Contacts/Card.service.js Diff File
mod - UI/WebServerResources/js/Mailer/MessageEditorController.js Diff File

sogo: master af136eec

2016-06-16 16:21

francis


Details Diff
(js) Fix autocompletion of LDAP-based groups

Fixes 0003673
Affected Issues
0003673
mod - UI/WebServerResources/js/Contacts/AddressBook.service.js Diff File
mod - UI/WebServerResources/js/Scheduler/Component.service.js Diff File

Issue History

Date Modified Username Field Change
2016-05-14 21:08 ckreutzer New Issue
2016-05-14 21:08 ckreutzer File Added: system.log.txt
2016-05-19 09:39 Christian Mack Note Added: 0010173
2016-05-19 09:48 ckreutzer Note Added: 0010174
2016-05-19 10:32 francis Target Version => 3.1.1
2016-05-19 10:59 ckreutzer Note Added: 0010178
2016-05-19 14:14 ckreutzer Note Added: 0010183
2016-05-19 21:25 francis Changeset attached => sogo master cc283575
2016-05-19 21:25 francis Assigned To => francis
2016-05-19 21:25 francis Resolution open => fixed
2016-05-19 21:26 francis Status new => assigned
2016-05-19 21:26 francis Fixed in Version => 3.1.1
2016-05-20 17:26 ckreutzer Note Added: 0010193
2016-05-20 18:11 ludovic Status assigned => resolved
2016-06-11 17:14 ckreutzer Note Added: 0010348
2016-06-11 17:14 ckreutzer Status resolved => feedback
2016-06-11 17:14 ckreutzer Resolution fixed => reopened
2016-06-11 18:32 ckreutzer Note Added: 0010349
2016-06-11 18:32 ckreutzer Status feedback => assigned
2016-06-16 21:30 francis Changeset attached => sogo master af136eec
2016-08-05 23:20 ludovic Note Added: 0010586
2016-08-05 23:20 ludovic Status assigned => closed
2016-08-05 23:20 ludovic Resolution reopened => fixed