Instead of overcomplicating things I have just going to try and login with one server and one domain:
login to SERVER1 on domain mydomain1.co.uk
I login with username and password. I can login fine but when i login round cube auto assumes my email address is:
username@mydomain1.co.ukthis is not correct. my real email is:
firstname.lastname@mydomain1.co.ukNow I can change my identity manually but then when I come to send email it is still trying to send emails with my logged in user name and not sending with the account:firstname.lastname@mydomain1.co.uk
I know I can pull a users email address out of AD using LDAP
$ds = ldap_connect($host);
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ds, LDAP_OPT_REFERRALS, 0);
$r = ldap_bind($ds, $_POST['Username'].$suffix, $_POST['Password']);
$filter = "samaccountname=".$_POST['Username'];
$fields = array("mail");
$sr = ldap_search($ds, $base_dn, $filter, $fields);
$entries = ldap_get_entries($ds, $sr);but I would have no clue where to put this in roundcube....