@fbartels
After applying the following modifications I finally got it working with the email address as the login.
First in /usr/share/kopano-webapp/client/kopano-debug.js ( not sure but it seems the part I modified comes from kopano-webapp/client/zarafa/core/data/UserIdObjectFactory.js):
// Add ZARAFA specific fields to the object
var recordEntryId = record.get('entryid');
var recordUsername = record.get('username');
var recordEmailAddress = record.get('email_address');
var recordSmtpAddress = record.get('smtp_address');
user.entryid = recordEntryId;
// Try to be smart to find the username and email address.
// Sometimes the username is available in the email_address field,
// sometimes the email address is available in the username field,
// and sometimes it is available in the smtp_address field.
if ( Ext.isString(recordUsername) && recordUsername.indexOf('@')==-1 ){
user.username = recordUsername;
} else if ( Ext.isString(recordEmailAddress) && recordEmailAddress.indexOf('@')==-1 ){
user.username = recordEmailAddress;
}
In my debugging recordUsername is empty/undefined because record.get(‘username’); returns nothing as there’s no username in record, eg:
account: ""
address_type: "ZARAFA"
assistant: ""
business2_telephone_number: ""
business2_telephone_number_mv: ""
business_telephone_number: ""
comment: ""
company_name: ""
country: ""
department_name: "IT"
display_name: "User2 Adeus"
display_type: 0
display_type_ex: 1073741824
email_address: "user2@adeus.pt"
entryid: "00000000ac21a95040d3ee48b319fba753304425010000000600000072000000457949424c762f4471306d7069456e355873375a41513d3d00000000"
fileas: "user2@adeus.pt"
full_name: "Adeus, User2"
given_name: "User2"
home2_telephone_number: ""
home2_telephone_number_mv: ""
home_telephone_number: ""
initials: ""
locality: ""
message_class: undefined
mobile_telephone_number: ""
object_type: 6
office_location: ""
office_telephone_number: ""
pager_telephone_number: ""
postal_code: ""
primary_fax_number: ""
search_key: "5a41524146413a55534552324041444555532e505400"
smtp_address: "user2@adeus.pt"
state_or_province: ""
street_address: ""
surname: "Adeus"
title: ""
Also noticed that email_address in record is populated with ldap_loginname_attribute.
So when you test else if ( Ext.isString(recordEmailAddress) && recordEmailAddress.indexOf('@')==-1 ){ user.username = recordEmailAddress; }, and are using an email as the login, it will fail and user.username will be empty. To make it work I changed it to else if ( Ext.isString(recordEmailAddress) { user.username = recordEmailAddress; }
The other file I modified was /usr/share/kopano-webapp/plugins/spreedwebrtc/jsspreedwebrtc-debug.js:
/**
* Will either add or remove an email_address to the watch list
*
* @param {String} email_address The email address to remove or add
* @param {String} remove optionally remove the user from the watch list
* @private
*/
updatePresenceWatchingList: function(email_address, entryId, smtp_address, remove) {
if (!email_address || 0 === email_address.length) { return; }
// skip non-Kopano email addresses
if (email_address.indexOf('@') > -1) { return; }
var index = this.presenceWatchingList.indexOf(email_address);
Same issue here. Removed if (email_address.indexOf('@') > -1) { return; }
so I don’t get an empty watch list and subsequent empty presence request.
With this modifications presence works using either sAMAccountName or mail as ldap_loginname_attribute.
Keep in mind that I’m no software developer nor do I know if there are implications anywhere else in Kopano. Hope this helps you solve the issue.