commit e70ba72df6764475457bfc52333b3fde8606e43c
Author: David Faure <faure@kde.org>
Date:   Thu Jan 12 12:54:28 2012 +0100

    Set an error code when we lost connection.
    
    Otherwise the imap resource assumes we could log in, and stores the session
    that just got deleted, leading to crashes further down the road.

diff --git a/kimap/loginjob.cpp b/kimap/loginjob.cpp
index e57ebd2..fcd019b 100644
--- a/kimap/loginjob.cpp
+++ b/kimap/loginjob.cpp
@@ -497,6 +497,8 @@ void LoginJob::connectionLost()
   //don't emit the result if the connection was lost before getting the tls result, as it can mean
   //the TLS handshake failed and the socket was reconnected in normal mode
   if (d->authState != LoginJobPrivate::StartTls) {
+    setError( LoginJob::UserDefinedError );
+    // setErrorText( "" ); ?
     emitResult();
   }
 
