[Kde-pim] kmail error recovery improvements
Will Stephenson
wstephenson at kde.org
Wed Mar 28 21:28:12 BST 2007
Hi all
The following patches solve
https://bugzilla.novell.com/show_bug.cgi?id=247903 . The problem is that
KMail won't let the user stop an imap connection which is failing due to
incorrect connection settings such as SSL/TLS where the server does not
support it, and continues to try to make a connection, preventing the user
from altering the settings. The only way out is to edit the config file, so
this bug is serious in my opinion.
The fix is in two parts. Firstly, ImapAccountBase::slotSchedulerSlaveError()
does not check the return code of makeConnection(), so the connection
sequence continues. I admit that I don't understand this 'connection
sequence' above fully. My first patch abandons the connection attempt
completely by emitting connectionResult and disconnecting the slave.
Secondly, kio_imap4 does not distinguish between failure to login due to bad
passwords and failure due to incorrect security settings. Given the change
to slotSchedulerSlaveError() in my first patch, this causes kmail to ask
again for a password in the second case, which will make the user assume that
despite the error message the password is to blame. I have patched the slave
to error with KIO::ERR_COULD_NOT_LOGIN in the bad security case and
KIO::ERR_COULD_NOT_AUTHENTICATE in the bad password case.
A further improvement that I have not implemented would be to make changes to
kio_imap4's imapParser::clientAuthenticate() to make it distinguish between
failure due to no SASL mech capability, and failure due to bad credentials,
so we could use ERR_COULD_NOT_LOGIN if the server does not support SASL but
the account is configured to use it. I don't want to do this myself as I am
not enough of an expert in these authentication types.
I've tested this myself for
*) bad password
*) bad remote username
*) bad security settings
*) host unreachable
*) imap server not running
and it seems ok but I'd love it if one of the kmail guys could look it over
before I commit.
Will
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cancelconnection.diff
Type: text/x-diff
Size: 1736 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20070328/0e9368d2/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: changeimaperror.diff
Type: text/x-diff
Size: 1795 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20070328/0e9368d2/attachment-0001.diff>
-------------- next part --------------
_______________________________________________
kde-pim mailing list
kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/
More information about the kde-pim
mailing list