Bug 97324 - password sometimes not saved into kwallet
Summary: password sometimes not saved into kwallet
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-18 11:58 UTC by _
Modified: 2007-09-14 12:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ 2005-01-18 11:58:11 UTC
Version:            (using KDE KDE 3.3.91)
Installed from:    Compiled From Sources
Compiler:          gcc 3.4.3 
OS:                Linux

I found that my pop3 password is not always saved into KWallet when I get asked for it on KMail startup. Workaround: Modifying the account (but not changing anything) and clicking OK saves the password into the wallet.
Comment 1 S. Burmeister 2005-01-18 12:08:49 UTC
Kind of the same problem here. I knew about the kwallet integration and thus had a look at the settings. I still found the textfield for the password as well as the switch to save the password in the config-file (at least the German translation reads like that). So as I did not want my password saved in the config-file, I switched it off.
Now I am asked everytime I start kontact for the password, without the option to save it.
I would expect kmail to ask me, whether I want to save my password, i.e. in kwallet. Usually this is done by providing a little checkbox: remeber password or something like that. Or kwallet askes, whether it should save the password.

It seems to me, that I have to switch on that checkbox to save password in config-file and enter it in the textfield, in order to get it saved to kwallet.
Comment 2 _ 2005-01-18 12:13:05 UTC
It also says "Store pop password in the configuration file" in the english version.
I got asked for my password, checking "Keep password" does remember it but it is only saved into the KWallet when I modify the account (and don't change anything). I have the "Store pop password in the configuration file" option enabled.
Comment 3 S. Burmeister 2005-01-18 12:38:14 UTC
Ah, I see, one has to enable "save password in config-file", yet leave that textfield empty to get the password dialogue including the remember option. Yet, if one does not switch on "remember password" the "save in config-file" is also disabled, which should not happen, as the user has clearly stated that s/he wants to save the password to somewhere by ticking the checkbox in the settings.

It works to save the passowrd in kwallet, when you enter the password in the textfield (settings) and switch on the "save in file".

When one enables the "save to config file" the account-entry is created in kwallet. Yet, as Mark reported, the "remember" functionality does not add the password to the account-entry.

I think that the "save to file" should be replaced by three radio buttons, or a drop-down list giving the following options.

Do not store password (savest)
Store password in kwallet (save)
Store password in config-file (least save)

The textfield to enter the password should be scraped as the user is asked for the password anyway when one checks for mail.
Comment 4 _ 2005-01-18 12:44:25 UTC
I think removing the textfield to enter the password isn't a good idea, as there might be several reasons for users to edit their password (but they can do that via the KWalletManager as well).
If there comes some remembermethod-selection, the "Keep password" checkbox when entering a password should be removed or changed too.
Oh, and it's "safest, safe, least safe/unsafe".
Comment 5 S. Burmeister 2005-01-18 13:06:56 UTC
> I think removing the textfield to enter the
> password isn't a good idea, as there might be several reasons for users to
> edit their password (but they can do that via the KWalletManager as well).

When there is the need to edit the password this usually implies that the old 
one is wrong. So this should simply be handled by the dialigue that handles 
the reply from the server when one submits the wrong password, shouldn't it?

You have supplied the wrong password
username: sjdfhd
password: jdhsdhsfd

That's where it can easily be changed if needed without having a textfield.

> If there comes some remembermethod-selection, the "Keep password" checkbox
> when entering a password should be removed or changed too. 

I do not quite understand what you mean by that. If I enabled "store password" 
and then am asked to enter it, but forget to enable the "remember password" 
checkbox, "store password" should be disabled and the user forced to go into 
the settings to re-enable it again?
People who do not want their password to be stored do not switch on that 
setting in the first place, hence most people who do not enable it in the 
kwallet dialogue simply forgot it and should not have to re-enable it again. 
Those who have switched it on by mistake and want to change are the minority 
and should therefore have to change the settings manually.

> Oh, and it's 
> "safest, safe, least safe/unsafe".

Ups, of course!

Comment 6 _ 2005-01-18 13:36:40 UTC
When I'm asked to enter my password (username/password), there is a checkbox "Keep password" in that dialog.
Comment 7 Volker Krause 2005-01-21 20:24:37 UTC
> I think that the "save to file" should be replaced by three radio buttons,
> or a drop-down list giving the following options.

This text has been replaced in the recent CVS version by 'Store password' + an 
explanation where KMail will save the password (wallet if available, config 
file otherwise).

The actually bug (lost passwords) seems to be similar to what is described in 
#95615 comment #7 and #12 - #14.

Can you confirm that the password is not lost if KMail is closed normally 
(File -> Quit), but only when closing on other ways (session management, 
crash, etc.)?

Comment 8 S. Burmeister 2005-01-21 21:26:55 UTC
> Can you confirm that the password is not lost if KMail is closed normally
> (File -> Quit), but only when closing on other ways (session management,
> crash, etc.)?

I have kontact hanging quite often when trying to shut it down. I do not know 
how to track down such an issue. I will test again, but I think I tried 
saving the password when I could quit kontact normally, so I do not think 
that this is due to it not shutting down properly. I have kwallet configured 
the way that it always allows kmail to get the passwords from it, thus I am 
not asked for a password on quitting kmail/kontact.

Comment 9 S. Burmeister 2005-01-21 21:31:16 UTC
> Can you confirm that the password is not lost if KMail is closed normally
> (File -> Quit), but only when closing on other ways (session management,
> crash, etc.)?

Forget my former comment, at least the part about the password not being saved 
with a clean shutdown. I just tried again, it is saved when I quit kontact.
The problem remaining for me is that kontact gets stuck that often when I want 
to quit it.

Comment 10 Volker Krause 2005-01-23 14:48:53 UTC
#97716 (KWallet bug) seems to be the reason for this.
Comment 11 David Faure 2006-09-14 11:20:48 UTC
SVN commit 584180 by dfaure:

Write the password (to wallet or config file) immediately after setting it in the auth dialog,
not when kmail exits cleanly (which it doesn't do when session management terminates it)
BUG: 97324, 98545


 M  +3 -0      networkaccount.cpp  


--- branches/KDE/3.5/kdepim/kmail/networkaccount.cpp #584179:584180
@@ -105,6 +105,9 @@
       mPasswdDirty = true;
     }
     setStorePasswd( storeInConfig );
+    if ( storeInConfig ) {
+      kmkernel->acctMgr()->writeConfig( true );
+    }
   }
 
   void NetworkAccount::clearPasswd() {
Comment 12 David Faure 2006-09-14 16:29:44 UTC
SVN commit 584361 by dfaure:

Move fix to right place, previous fix broke loading.
CCBUG: 97324, 98545


 M  +0 -3      networkaccount.cpp  
 M  +3 -0      popaccount.cpp  


--- trunk/KDE/kdepim/kmail/networkaccount.cpp #584360:584361
@@ -105,9 +105,6 @@
       mPasswdDirty = true;
     }
     setStorePasswd( storeInConfig );
-    if ( storeInConfig ) {
-      kmkernel->acctMgr()->writeConfig( true );
-    }
   }
 
   void NetworkAccount::clearPasswd() {
--- trunk/KDE/kdepim/kmail/popaccount.cpp #584360:584361
@@ -153,6 +153,9 @@
         return;
       } else {
         setPasswd( passwd, b );
+        if ( b ) {
+          kmkernel->acctMgr()->writeConfig( true );
+        }
         mAskAgain = false;
       }
     }