Hey Janos,

okay problem located in model/user/auth.php

You check a lot of times for $ldap_mail_attr in system/misc.php which I’ve set 
correctly to „mail" in my config-site.php using $config['LDAP_MAIL_ATTR'] = 
'mail‘;

But in model/user/auth.php you still ignore all parameters you looked up 
previously and set a static in line 367.
$query = $ldap->query(LDAP_BASE_DN, 
"(|(&(objectClass=user)(proxyAddresses=smtp:$username))(&(objectClass=group)(member=$username))(&(objectClass=group)(member="
 . stripslashes($a['dn']) . ")))", array());
 
I have replaced "proxyAddress=smtp:“  by my ldap_mail_attribute without 
userprefix to „mail“.  


Now everything works fine for me.


For all other people who wants to use sso.php without MS-Exchange-Server there 
is a lot of work.  I think you can call it version 1.1.1  😃


TODO:  really make use of LDAP_MAIL_ATTR  and add LDAP_MAIL_USERPREFIX  to 
replace default smtp: with an empty string.



Kind regards
Chris






> Am 12.01.2015 um 16:09 schrieb Christian Vielhauer <[email protected]>:
> 
> Hello Janos,
> 
> thanks for reply. 
> 
> Attached you find the mail.log file….
> 
> The four other files are the manual ldapsearch query with filter used from 
> mail.log.
> 
> sso-query2.rtf shows the unsuccessful query…. I think because of using 
> proxyAddress=smtp
> The maladies found in sso-query1.rtf is correct and used in query2...
> 
> 
> <login-query1.rtf>
> <login-query2.rtf>
> <maillog.rtf>
> <sso-query1.rtf>
> <sso-query2.rtf>
> 
> 
> 
> 
> 
>> Am 12.01.2015 um 10:59 schrieb Janos SUTO <[email protected] 
>> <mailto:[email protected]>>:
>> 
>> 
>> Hello Chris,
>> 
>> I think the ldap query the piler gui uses in case of an SSO login
>> is not correct, that's why it can't find your email addresses.
>> 
>> Can you show me the ldap query from your maillog, and the result if
>> you issue it manually using ldapsearch?
>> 
>> Janos
>> 
>> On 2015-01-11 17:32, Christian Vielhauer wrote:
>>> Hi
>>> eventually this helps more than my long description 😃
>>> with following config:
>>>> $config['ENABLE_IMAP_AUTH'] = 0;
>>>> $config['ENABLE_SSO_LOGIN'] = 1;
>>>> $config['ENABLE_LDAP_AUTH'] = 1;
>>> When I login via SSO with DOMAINchristian and my pw
>>> I become logged in but I am not able to search through my archived mails
>>> In user-settings my maladies is NOT listed
>>> apache2/piler-error.log:
>>> [Sun Jan 11 17:24:43 2015] [error] [client 10.27.8.5] PHP Warning:
>>> PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: no
>>> parameters were bound in
>>> /var/www/mailarchiv.domain.com/system/database/mysql.php 
>>> <http://mailarchiv.domain.com/system/database/mysql.php> [1] on line
>>> 46, referer: https://mailarchiv.domain.com/logout.php 
>>> <https://mailarchiv.domain.com/logout.php> [2]
>>> When I login with same settings via login.php with
>>> [email protected] <mailto:[email protected]> and my pw
>>> I become logged in and I can search through my archived mails
>>> In user-settings my maladies is listed correctly
>>>> Am 11.01.2015 um 15:13 schrieb Christian Vielhauer <[email protected] 
>>>> <mailto:[email protected]>>:
>>>> Hello Janos,
>>>> now piler is upgrades from 0.1.25-rc2 to 1.1.0 and all mails are reindex 
>>>> because of new sphinx installation, too.
>>>> Because I now using a domain (samba4) in my test lab I want to try so 
>>>> instead of plain imap-login.
>>>> With sogo/openchange it works great, so I thought using parameters as used 
>>>> for sogo.
>>>> So far everything works.
>>>> I can login using sso.php, but I can’t see my maladies in 
>>>> username->settings and I am not able to search my archive because the 
>>>> empty mailaddress field.
>>>> I can login using sso.php with DOMAINchristian
>>>> —> then in username->settings->email address: <None found>
>>>> I can login using sso.php with [email protected] 
>>>> <mailto:[email protected]>
>>>> —> then in username->settings->email address: <None found>
>>>> I cannot login using login.php with [email protected] 
>>>> <mailto:[email protected]> or with DOMAINchristian
>>>> —> thats ok because i have to enter my correct emailaddress 
>>>> [email protected] <mailto:[email protected]>
>>>> I can login using login.php with [email protected] 
>>>> <mailto:[email protected]> <<<<< thats my emailaddress
>>>> —> then in username->settings->email address: <[email protected] 
>>>> <mailto:[email protected]>>
>>>> And I am able to search for mails.
>>>> My config-site.php:
>>>> $config['ENABLE_IMAP_AUTH'] = 0;
>>>> $config['ENABLE_SSO_LOGIN'] = 1;
>>>> $config['ENABLE_LDAP_AUTH'] = 1;
>>>> $config['LDAP_HOST'] = 'ad1.domain.local';
>>>> $config['LDAP_BASE_DN'] = 'OU=employees,dc=domain,dc=local';
>>>> $config['LDAP_HELPER_DN'] = 'CN=piler,CN=users,DC=domain,DC=local';
>>>> $config['LDAP_HELPER_PASSWORD'] = 'xxxxxxxx';
>>>> $config['LDAP_MAIL_ATTR'] = 'mail';
>>>> I think my problem is the different username for domain then the 
>>>> emailaddress.
>>>> So I try ldapsearch for my emailaddress:
>>>> ldapsearch -h ad1.domain.local -D 'CN=piler,CN=users,DC=domain,DC=local' 
>>>> -b ‚OU=employees,DC=domain,DC=local' -x -W 
>>>> '(&(objectClass=user)([email protected] 
>>>> <mailto:[email protected]>))'
>>>> ….
>>>> userPrincipalName: [email protected] <mailto:[email protected]>
>>>> sAMAccountName: christian
>>>> mail: [email protected] <mailto:[email protected]>
>>>> givenName: Christian
>>>> …
>>>> So I need to map the ‚mail‘-attribute to the Emailaddress-filed in 
>>>> Username->settings.
>>>> Hope you understand what’s going wrong in my case.
>>>> Why the mail-attribute is not bind to emailaddress after login.
>>>> Chris
>>> Links:
>>> ------
>>> [1] http://mailarchiv.domain.com/system/database/mysql.php 
>>> <http://mailarchiv.domain.com/system/database/mysql.php>
>>> [2] https://mailarchiv.domain.com/logout.php 
>>> <https://mailarchiv.domain.com/logout.php>

Reply via email to