Multiple mail identities for the mail account of the user is a long missing feature of sogo.

I have created a patch, that:
- Allows SOGOUserSource objects to override the identity associated with the current user.
- Modified the mail editor UI to support multiple identities and set their settings on the UIxMailEditor page
- Added proper replyTo support for mails
- Modified the preferences UI to provie a list of identities available for the main account
- System warns about incompatibility with Aux mail accounts
- Removed currentIndex lastIndex madness from UIxMailToSelect component.

I'd kindly ask you to provide comments on this patch and if it seems fine please include it in git.

Note that SQLSource does not implement the interface yet. The patch is aganst the 2.0.3a debian codebase.

The configuration is done via the following defaults:
sogod SOGoMailExtendedLDAPIdentitySettings '{
    baseDN = "uid=%U,ou=people,dc=caesar,dc=elte,dc=hu";
    filter = "(objectClass=mailIdentity)";
    identityBCC = identityBCC;
    identityCC = identityCC;
    identityConfirmed = identityConfirmed;
    identityFromAddress = identityFromAddress;
    identityFromName = identityFromName;
    identityReplyTo = identityReplyTo;
    identitySignature = identitySignature;
    identityWeight = identityWeight;
}'

sogod SOGoMailExtendedIdentities YES

The baseDN is the dn under the %U gets replaced with the username and %D gets replaced with the domain the user logs into.

Search is performed under this dn, searching for the filter criteria.

The identity* fields specify the attributes with the given value.

This can be set also on domain level.

This can be used with ldap entries like this:

dn: identityFromAddress=sdsadystem@caesar.elte.hu,uid=tasdurip,ou=People,dc=caesar,dc
 =elte,dc=hu
objectClass: top
objectClass: mailIdentity
identityBCC: Caesar rendszergazda <sydsastem@caesar.elte.hu>
identityFromName: Caesar rendszergazda
identityConfirmed: TRUE
identitySignature: Caesar rendszergazda stb
identityFromAddress: sydsastem@caesar.elte.hu
identityReplyTo: norepdsly@caesar.elte.hu
identityWeight: 10

identityFromAddress=turip@cdsadaesar.elte.hu,uid=tasdurip,ou=People,dc=caesar,dc=
 elte,dc=hu
objectClass: top
objectClass: mailIdentity
identityFromName: Turi Peter
identityConfirmed: TRUE
identitySignature:: UGxhc3RpYyBleGlzdGFuY2Ug
identityFromAddress: turiasddsap@caedsadsasar.elte.hu
identityCC: Test <testsasd@casddsadaesar.elte.hu>
identityWeight: 1

The following schema can be used to store these objects (the oids are registered and reserved for this system):

dn: cn={4}elte
objectClass: olcSchemaConfig
cn: {4}elte
olcObjectIdentifier: {0}ISO 1
olcObjectIdentifier: {1}ORG ISO:3
olcObjectIdentifier: {2}DOD ORG:6
olcObjectIdentifier: {3}INTERNET DOD:1
olcObjectIdentifier: {4}PRIVATE INTERNET:4
olcObjectIdentifier: {5}ENTERPRISE PRIVATE:1
olcObjectIdentifier: {6}ELTE ENTERPRISE:6807
olcObjectIdentifier: {7}ELTELDAP ELTE:1
olcObjectIdentifier: {8}ELTEAttr ELTELDAP:1
olcObjectIdentifier: {9}ELTEClass ELTELDAP:2
olcObjectIdentifier: {10}ELTESyntax ELTELDAP:3
olcAttributeTypes: {18}( ELTEAttr:1001 NAME 'identityCC' DESC 'Mail addresses to include in the cc list for this identity' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
olcAttributeTypes: {19}( ELTEAttr:1002 NAME 'identityBCC' DESC 'Mail addresses to include in the bcc list for this identity' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
olcAttributeTypes: {20}( ELTEAttr:1003 NAME 'identityReplyTo' DESC 'Mail addresses to send the reply to' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE)
olcAttributeTypes: {21}( ELTEAttr:1004 NAME 'identityFromAddress' DESC 'Email address for this identity' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE)
olcAttributeTypes: {22}( ELTEAttr:1005 NAME 'identityFromName' DESC 'Display name for the given from field' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE)
olcAttributeTypes: {23}( ELTEAttr:1006 NAME 'identitySignature' DESC 'User signature' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE)
olcAttributeTypes: {24}( ELTEAttr:1007 NAME 'identityConfirmed' DESC 'Is the given identity enabled to the user?' EQUALITY BooleanMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )
olcAttributeTypes: {25}( ELTEAttr:1008 NAME 'identityWeight' DESC 'Ordering for the identities' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )
olcObjectClasses: {9}( ELTEClass:1000 NAME 'mailIdentity' DESC 'Mail identity of the given user' SUP top STRUCTURAL MUST identityFromAddress MAY ( identityCC $ identityBCC $ identityReplyTo $ identityFromName $ identitySignature $ identityConfirmed $ identityWeight ) )