Bug 93199 - [regression] can't cancel password input
Summary: [regression] can't cancel password input
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Unclassified
Component: IMAP (show other bugs)
Version: 1.7.50
Platform: unspecified Linux
: NOR normal with 36 votes (vote)
Target Milestone: ---
Assignee: Will Stephenson
URL:
Keywords:
: 107836 109036 116438 120660 136646 142030 142330 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-11-13 09:45 UTC by Thomas Zander
Modified: 2007-04-14 16:49 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
proposed patch part 1, allow cancel (1.70 KB, patch)
2007-03-28 22:39 UTC, Will Stephenson
Details
patch 2, don't ask for password due to missing SSL/TLS (1.75 KB, patch)
2007-03-28 22:39 UTC, Will Stephenson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Zander 2004-11-13 09:45:41 UTC
Version:           1.7.50 (using KDE 3.3.89 (CVS >= 20041104), compiled sources)
Compiler:          gcc version 3.3.4 (Debian)
OS:                Linux (i686) release 2.4.21

Connecting to a remote IMAP host (ssl) I was asked to type my password.  Since it now comes from my wallet instead of my config I failed to provide it (I really don't know..)

Anyway; I could press 'cancel' all I wanted.  I also closed the server (collapsed it in the tree) but I still got asked for my pwd an infinite number of times.

I keep going through:
'Authorization dialog' (which I press Cancel on)
and then an 'error KMail'
Unable to authenticate via DIGEST-MD5.\nThe server replied:\nincorrect password or account name
Comment 1 Thomas Zander 2004-12-17 21:12:09 UTC
*** Bug has been marked as fixed ***.
Comment 2 Ralf Hildebrandt 2006-05-03 16:38:58 UTC
I see the same problem today (REGRESSION?) with 3.5.2-1+b1 from debian/unstable
Comment 3 Bram Schoenmakers 2006-10-31 09:13:46 UTC
Bug is still there
Comment 4 Bram Schoenmakers 2006-10-31 09:14:10 UTC
*** Bug 109036 has been marked as a duplicate of this bug. ***
Comment 5 Philip Rodrigues 2006-11-01 00:13:38 UTC
*** Bug 116438 has been marked as a duplicate of this bug. ***
Comment 6 Philip Rodrigues 2006-11-01 18:22:59 UTC
*** Bug 136646 has been marked as a duplicate of this bug. ***
Comment 7 Tommi Tervo 2006-11-07 16:03:15 UTC
*** Bug 107836 has been marked as a duplicate of this bug. ***
Comment 8 Chris 2007-01-31 00:12:35 UTC
Same problem with kmail 1.9.6. Selected not supported login method (e.g. CRAM-MD5 instead of Simple Text) then password dialog cannot be cancelled. After restarting (with checking mail on start enabled) it is even difficult to reach the relevant setting then when the password dialog cannot be cancelled.
Comment 9 David Cannings 2007-02-18 15:11:38 UTC
Exactly the same problem for me, when not connecting via TLS (because the server is configured to reject unless a secure session is being used).

Sequence of events:

1) ask for password 
2) say that LOGIN is disabled 
3) goto 1

I'll probably fix it by editing the configuration manually, but this is a major pain :)
Comment 10 Thomas McGuire 2007-02-21 18:40:37 UTC
*** Bug 142030 has been marked as a duplicate of this bug. ***
Comment 11 Thomas McGuire 2007-02-28 15:17:53 UTC
*** Bug 142330 has been marked as a duplicate of this bug. ***
Comment 12 Bram Schoenmakers 2007-03-11 00:28:04 UTC
*** Bug 120660 has been marked as a duplicate of this bug. ***
Comment 13 Jorge Godoy 2007-03-18 14:36:13 UTC
The problem is still present in the latest KDE released with OpenSuSE 10.2, KMail 1.9.5.

But it just shows up if you type your password for the first time.  If you cancel on the dialog box before the kamil window opens, then it will be possible to make the changes.

This is a real bug and a real PITA when a user gets this problem.
Comment 14 Stefan Haun 2007-03-18 14:39:43 UTC
If the problem is based on wrong credentials, this might help.

My problem was a server that switched the authentication mechanism. KMail did not allow me to open the configuration dialog and change the settings due to this bug.
Comment 15 Jorge Godoy 2007-03-18 15:21:41 UTC
That was the same case here.  The server changed from using TLS to using SSL on the right port (IMAPS).
Comment 16 Will Stephenson 2007-03-28 22:39:22 UTC
Created attachment 20116 [details]
proposed patch part 1, allow cancel
Comment 17 Will Stephenson 2007-03-28 22:39:59 UTC
Created attachment 20117 [details]
patch 2, don't ask for password due to missing SSL/TLS
Comment 18 Will Stephenson 2007-03-28 22:44:54 UTC
Downstream report at https://bugzilla.novell.com/show_bug.cgi?id=247903
Comment 19 Will Stephenson 2007-04-14 16:49:56 UTC
SVN commit 653900 by wstephens:

Allow the user to cancel kmail connection attempts when the account
settings are incorrect (Novell bug 247903).
BUG:93199


 M  +2 -2      kioslaves/imap4/imap4.cc  
 M  +20 -13    kmail/imapaccountbase.cpp  


--- branches/KDE/3.5/kdepim/kioslaves/imap4/imap4.cc #653899:653900
@@ -2020,14 +2020,14 @@
         }
       }
       if (!clientLogin (myUser, myPass, resultInfo))
-        error(KIO::ERR_COULD_NOT_LOGIN, i18n("Unable to login. Probably the "
+        error(KIO::ERR_COULD_NOT_AUTHENTICATE, i18n("Unable to login. Probably the "
         "password is wrong.\nThe server %1 replied:\n%2").arg(myHost).arg(resultInfo));
     }
     else
     {
 #ifdef HAVE_LIBSASL2
       if (!clientAuthenticate (this, authInfo, myHost, myAuth, mySSL, resultInfo))
-        error(KIO::ERR_COULD_NOT_LOGIN, i18n("Unable to authenticate via %1.\n"
+        error(KIO::ERR_COULD_NOT_AUTHENTICATE, i18n("Unable to authenticate via %1.\n"
 	"The server %2 replied:\n%3").arg(myAuth).arg(myHost).arg(resultInfo));
       else {
         myUser = authInfo.username;
--- branches/KDE/3.5/kdepim/kmail/imapaccountbase.cpp #653899:653900
@@ -562,19 +562,19 @@
     if (aSlave != mSlave) return;
     handleError( errorCode, errorMsg, 0, QString::null, true );
     if ( mAskAgain )
-      makeConnection();
-    else {
-      if ( !mSlaveConnected ) {
-        mSlaveConnectionError = true;
-        resetConnectionList( this );
-        if ( mSlave )
-        {
-          KIO::Scheduler::disconnectSlave( slave() );
-          mSlave = 0;
-        }
+      if ( makeConnection() != ImapAccountBase::Error )
+        return;
+
+    if ( !mSlaveConnected ) {
+      mSlaveConnectionError = true;
+      resetConnectionList( this );
+      if ( mSlave )
+      {
+        KIO::Scheduler::disconnectSlave( slave() );
+        mSlave = 0;
       }
-      emit connectionResult( errorCode, errorMsg );
     }
+    emit connectionResult( errorCode, errorMsg );
   }
 
   //-----------------------------------------------------------------------------
@@ -892,7 +892,7 @@
     bool jobsKilled = true;
     switch( errorCode ) {
     case KIO::ERR_SLAVE_DIED: slaveDied(); killAllJobs( true ); break;
-    case KIO::ERR_COULD_NOT_LOGIN: // bad password
+    case KIO::ERR_COULD_NOT_AUTHENTICATE: // bad password
       mAskAgain = true;
       // fallthrough intended
     case KIO::ERR_CONNECTION_BROKEN:
@@ -901,6 +901,7 @@
       // These mean that we'll have to reconnect on the next attempt, so disconnect and set mSlave to 0.
       killAllJobs( true );
       break;
+    case KIO::ERR_COULD_NOT_LOGIN:
     case KIO::ERR_USER_CANCELED:
       killAllJobs( false );
       break;
@@ -1042,7 +1043,7 @@
     msg->deleteBodyParts();
     // make the parts and fill the mBodyPartList
     constructParts( stream, 1, 0, 0, msg->asDwMessage() );
-    if ( mBodyPartList.count() == 1 ) // we directly set the body later
+    if ( mBodyPartList.count() == 1 ) // we directly set the body later, at partsToLoad below
       msg->deleteBodyParts();
 
     if ( !as )
@@ -1068,6 +1069,12 @@
         ++partsToLoad;
       }
     }
+    // if the only body part is not text, part->loadPart() would return false
+    // and that part is never loaded, so make sure it loads. 
+    // it seems that TEXT does load the single body part even if it is not text/*
+    if ( mBodyPartList.count() == 1 && partsToLoad == 0 )
+        partsToLoad = 1;
+
     if ( (mBodyPartList.count() * 0.5) < partsToLoad )
     {
       // more than 50% of the parts have to be loaded anyway so it is faster