Summary: | kmail should remember smtp password | ||
---|---|---|---|
Product: | [Unmaintained] kmail | Reporter: | Ali Bayazit <test1> |
Component: | general | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | kdebugs |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | RedHat Enterprise Linux | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Proposed patch (tested on the 3.5.x branch) |
Description
Ali Bayazit
2002-09-29 18:59:19 UTC
I'd also like to see this implemented. KMail now supports saving SMTP password in its configuration file. Please upgrade if you haven't done already so. I don't think that comment #2 answers the feature request of the original poster. Ali wants kmail to remember the password per session, so that the password is not stored in a file (and all backups). I would be very happy to see the same feature. The caching isn't fixed. That's why I reopen the wish. Caching should work like for receiving or for signing where you have to provide the password only once per KMail session. Storing the password in the config file is not really related. Also, I would like to see an option that says POP and SMTP passwords are the same. Password should be cached. As said above, I would not like to have my password stored in the config file I am using KDE 3.5.1 level a. on a SUSE 10.1 Linux distribution and this SMTP password bug is not fixed as yet. Everything I have tried does not work everytime I send an email I am asked whether or not I want to save my password to a configuration file and I say yes and it never saves it. I also vote for this one and for the #5 proposal. This bug is somewhat old, and I don't that implementing this could be difficult. Just for general interest, thunderbird has already this option, and I also would like that my favourite mail reading app has it. Thank you. Created attachment 19666 [details]
Proposed patch (tested on the 3.5.x branch)
SVN commit 633276 by winterz: Make KMail remember the SMTP password. Thanks for the patch Luigi. CCBUGS: 48461 M +14 -0 branches/work/kdepim-3.5.5+/kmail/kmsender.cpp M +2 -0 branches/work/kdepim-3.5.5+/kmail/kmsender.h --- branches/work/kdepim-3.5.5+/kmail/kmsender.cpp #633275:633276 @@ -723,6 +723,11 @@ mOutboxFolder->unGetMsg( mFailedMessages ); mCurrentMsg = 0; mFailedMessages++; + // reset cached password + QMapIterator <QString,QString> pc; + if ( (pc = mPasswdCache.find( mMethodStr )) != mPasswdCache.end() ) { + mPasswdCache.erase(pc); + } // Sending of message failed. if (!errString.isEmpty()) { int res = KMessageBox::Yes; @@ -1093,6 +1098,12 @@ if (ti->auth) { + QMapIterator<QString,QString> tpc = mSender->mPasswdCache.find( ti->name ); + QString tpwd = ( tpc != mSender->mPasswdCache.end() )?(*tpc):QString::null; + + if ( ti->passwd().isEmpty() ) + ti->setPasswd( tpwd ); + if( (ti->user.isEmpty() || ti->passwd().isEmpty()) && ti->authType != "GSSAPI" ) { @@ -1113,6 +1124,9 @@ if (int id = KMTransportInfo::findTransport(ti->name)) { ti->setPasswd( passwd ); ti->writeConfig(id); + + // save the password into the cache + mSender->mPasswdCache[ti->name] = passwd; } } destination.setUser(ti->user); --- branches/work/kdepim-3.5.5+/kmail/kmsender.h #633275:633276 @@ -30,6 +30,7 @@ #include <qcstring.h> #include <qstring.h> #include <qstringlist.h> +#include <qmap.h> #include <qobject.h> #include <kdeversion.h> @@ -167,6 +168,7 @@ int mSentMessages, mTotalMessages; int mSentBytes, mTotalBytes; int mFailedMessages; + QMap<QString,QString> mPasswdCache; }; #endif /*kmsender_h*/ SVN commit 653892 by winterz: merge SVN commit 633276 by winterz: Make KMail remember the SMTP password. Thanks for the patch Luigi. BUGS: 48461 M +14 -0 kmsender.cpp M +2 -0 kmsender.h --- branches/KDE/3.5/kdepim/kmail/kmsender.cpp #653891:653892 @@ -707,6 +707,11 @@ mOutboxFolder->unGetMsg( mFailedMessages ); mCurrentMsg = 0; mFailedMessages++; + // reset cached password + QMapIterator <QString,QString> pc; + if ( (pc = mPasswdCache.find( mMethodStr )) != mPasswdCache.end() ) { + mPasswdCache.erase(pc); + } // Sending of message failed. if (!errString.isEmpty()) { int res = KMessageBox::Yes; @@ -1077,6 +1082,12 @@ if (ti->auth) { + QMapIterator<QString,QString> tpc = mSender->mPasswdCache.find( ti->name ); + QString tpwd = ( tpc != mSender->mPasswdCache.end() )?(*tpc):QString::null; + + if ( ti->passwd().isEmpty() ) + ti->setPasswd( tpwd ); + if( (ti->user.isEmpty() || ti->passwd().isEmpty()) && ti->authType != "GSSAPI" ) { @@ -1097,6 +1108,9 @@ if (int id = KMTransportInfo::findTransport(ti->name)) { ti->setPasswd( passwd ); ti->writeConfig(id); + + // save the password into the cache + mSender->mPasswdCache[ti->name] = passwd; } } destination.setUser(ti->user); --- branches/KDE/3.5/kdepim/kmail/kmsender.h #653891:653892 @@ -30,6 +30,7 @@ #include <qcstring.h> #include <qstring.h> #include <qstringlist.h> +#include <qmap.h> #include <qobject.h> #include <kdeversion.h> @@ -167,6 +168,7 @@ int mSentMessages, mTotalMessages; int mSentBytes, mTotalBytes; int mFailedMessages; + QMap<QString,QString> mPasswdCache; }; #endif /*kmsender_h*/ |