# Bugs #2880: Login though sitemgr looses password information resulting in failing imap login

**URL:** <https://help.egroupware.org/t/bugs-2880-login-though-sitemgr-looses-password-information-resulting-in-failing-imap-login/48949>\
**Category:** eGW-tracker\
**Created:** [August 22, 2011, 1:25pm UTC](https://help.egroupware.org/t/bugs-2880-login-though-sitemgr-looses-password-information-resulting-in-failing-imap-login/48949 "2011-08-22T13:25:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tracker-3](https://help.egroupware.org/letter_avatar_proxy/v4/letter/t/d07c76/32.png) [@tracker-3](https://help.egroupware.org/u/tracker-3)\
**Post date:** [August 22, 2011, 1:25pm UTC](https://help.egroupware.org/t/bugs-2880-login-though-sitemgr-looses-password-information-resulting-in-failing-imap-login/48949/1 "2011-08-22T13:25:51Z")

</div>

Ticket modified by Randy T at 2011/08/22 15:25  
Tracking SystemBugs  
CategorySiteMgr  
VersionVersion 1.8.001  
StatusOpen  
ResolutionNone  
Completed10%  
Priority5 - medium  
Created bySonni Nørløv  
Created on2011/03/06 21:02  
Assigned toKlaus Leithoff, José Luis Gordo Romero  
[Ccrt.egw@tarantino.us](mailto:Ccrt.egw@tarantino.us)  
Summary#2880 - Login though sitemgr looses password information resulting in failing imap login  
When logging in at /login.php I can successfully view my emails which are setup to use default imap login, no account specific email accounts exist on the system.

When I login though the login app in sitemgr, the email application cannot authenticate my imap account.

By adding some logging in the mail parts I can see that the value of $GLOBALS[‘egw\_info’][‘user’][‘passwd’] is empty when logged in though sitemgr.

Issue is easy to reproduce, so I will open to test patches.

For what it is worth, this issue started after upgrading first from 1.4 to 1.6 and quickly to 1.8. Don’t recall if 1.6 worked.  
Comment by Randy T at 2011/08/22 15:25:  
I attached screenshots of my Site Config specific to Security. I am not using cookies for authentications.

I am equally as confused on the AuthType because I am clearly using vmailmgr. Confirmed in the previous IMAP Profile config and the emailadmin profile over view I just attached.  
Comment by Klaus Leithoff at 2011/08/22 12:59:  
$GLOBALS[‘egw\_info’][‘user’][‘passwd’]  
should be set no matter what logintype. Its set on egw\_session::verify, unless the session is restored from session. If it is restored from session, it may not be set, if the session data  
never set that.  
-Do you use cookies for authentication (usecookies) for admin -\> site configuration?  
-Are you using the remember me - stuff?

furthermore i wonder why you have your LoginType set to admin, if you have only one Profile and this one is set to VMANAGER.  
Comment by Randy T at 2011/08/19 17:49:  
Here is the full output with AuthType.

emailadmin\_bo::getUserProfile647 User:myUser UserPwd: vs. ImapPassword: Using AuthType/LoginType:/admin  
Comment by Randy T at 2011/08/19 17:45:  
Here are the results of the debug output

emailadmin\_bo::getUserProfile643 User:myUser UserPwd: vs. ImapPassword:

When I have the User Specific profile enabled UserPwd: and ImapPassword: are populated as expected.  
Comment by Klaus Leithoff at 2011/08/19 11:11:  
To find out if it is passed or not.  
Go to emailadmin/inc/class.emailadmin\_bo.inc.php.  
Function getUserProfile  
Line 623  
Here the Profiles Password is set with the users Password wich is stored with the session  
and provided with $GLOBALS[‘egw\_info’][‘user’][‘passwd’]  
In Line 625 the loginType is determined.  
If the LoginType is admin the password (and LoginInfo) is overwritten with the configured data (see line 639-642)  
As far as I know, there is no other place, where the password Information is manipulated/set/retrieved.  
So if you put an  
error\_log( **METHOD**. **LINE**.’ User:’.$GLOBALS[‘egw\_info’][‘user’][‘account\_lid’].’ UserPwd:’.$GLOBALS[‘egw\_info’][‘user’][‘passwd’].’ vs. ImapPassword:’.$icServer-\>password.’ Using AuthType/LoginType:’.$imapAuthType.’/’.$icServer-\>loginType);  
in , say line643. We will see if there is a password at that time.  
Comment by Randy T at 2011/08/18 17:58:  
It is the only profile. As far as I can tell the connection is good however the authentication was failing as [AUTHENTICATIONFAILED] Authentication failed was returned in the EGW eMail screen.

When I captured the debug sequence I saw the following "myUser@example.com:". Note the password is blank.

To confirm I temporarily made the below change and was able to successfully login. I made the modification on line 518 in class.defaultimap.inc.php. I believe I incorrectly stated the password is not getting passed, however more accurately I tend to believe the password is NULL at the time of the connection.

```
           if($_adminConnection) {
                    $username = $this-&gt;adminUsername;
                    $password = $this-&gt;adminPassword;
                    $options = '';
                    $this-&gt;isAdminConnection = true;
            } else {
                    $username = $this-&gt;loginName;
                    $password = 'mysupersecretpassword'; //= $this-&gt;password;
                    $options = $_options;
                    $this-&gt;isAdminConnection = false;
            }

```

Comment by Klaus Leithoff at 2011/08/18 17:25:  
Thx,  
does not look half bad.  
Is this the only profile available?  
as refering to your debug session:  
-does the conection fail  
or  
-does the login fail.

Example:  
is he trying to login with  
[myUser@example.com](mailto:myUser@example.com):myPassword  
or is he trying with  
myUser:myPassword  
or  
myUser@anyotherdomain.suffix:myPassword

If the username is correct like  
[myUser@example.com](mailto:myUser@example.com)  
is the password used correct, or is it the password of anonymous, or is it empty

if the password is correct:  
does the server info match (,as expected)?  
Comment by Randy T at 2011/08/18 17:03:  
I have added screenshots of the emailadmin profile. Additionally to clarify with regard to my vmail setup you will see I am using a Standard IMAP Server vs the DBMail Schema. Essentially I have a Dovecot IMAP Server with virtual users reading from a database Table (hash and passwords matching EGW).

Randy  
Comment by Klaus Leithoff at 2011/08/18 15:31:  
Now I tested with a vmanager Profile.  
(Defined for a user)  
Still works as it should.  
Could you do a screenshot of your emailadmin profile(s)?  
(List with profiles available?) And post it with this trackerentry?  
Comment by Klaus Leithoff at 2011/08/18 15:12:  
Now I tested with a vmanager Profile.  
(Defined for a user)  
Still works as it should.  
Comment by Klaus Leithoff at 2011/08/18 14:57:  
I assigned myself. I will check now. Missed it completely  
Comment by Randy T at 2011/08/18 13:36:  
To clarify this seems to only be an issue when using vmanager.  
Comment by Randy T at 2011/08/18 01:08:  
I confirmed this issue with Trunk 1.9.011 as well.

Linked entries:  
[https://community.egroupware.org/egroupware/index.php?menuaction=tracker.tracker\_ui.edit&tr\_id=2880&no\_popup=1](https://community.egroupware.org/egroupware/index.php?menuaction=tracker.tracker_ui.edit&tr_id=2880&no_popup=1)
