Bug 258055 - Akonadi cannot handle "%" in passwords
Summary: Akonadi cannot handle "%" in passwords
Status: RESOLVED WORKSFORME
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: IMAP resource (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR major
Target Milestone: ---
Assignee: Kevin Ottens
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-27 11:20 UTC by wuselwu
Modified: 2010-12-02 05:14 UTC (History)
2 users (show)

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 wuselwu 2010-11-27 11:20:57 UTC
Version:           unspecified (using KDE 4.5.80) 
OS:                Linux

Using an existing IMAP-Account with a password which contains a "%" (followed by two digits, if that further matters) gives an error:
"A000003 BAD expected end of data instead of %(here are the two digits)"
...making the IMAP account in fact inaccessible for the user.



Reproducible: Always

Steps to Reproduce:
Happens both when migrating from old KDE 4.5-style and when trying to set up a new account in Akonadi.
Comment 1 Torgny Nyblom 2010-11-28 08:45:38 UTC
What IMAP server (make/model) is that, and could you post a log of the IMAP command/responces?

export KIMAP_LOGFILE="filename"; akonadictl restart

filename should now contain a log of all IMAP traffic so please post that after some cleaning.
Comment 2 wuselwu 2010-11-28 09:29:42 UTC
I only get logfiles with length "0" using the command you propose?!

The IMAP server (German provider "web.de") works flawless with all other clients and all other OSes, including KMail up to th version included with KDE 4.5.x. 
Maybe the "%" followed by a number is considered as some "escape code"?
Comment 3 wuselwu 2010-11-28 16:08:03 UTC
Somehow because of this error Akonadi for my case is stuck in the migration process from the old-style KMail accounts - it endlessly tries to migrate with every new start. However, also a strange message appears in the migration window: "User denied password access" or something like that, indicating Kwallet problems (which definitely should not exist as Kwallet gives Akonadi full access, and the other error message rather hints at problems with the IMAP server).
Comment 4 wuselwu 2010-11-28 16:51:47 UTC
I had to completely re-setup Akonadi and KMail (the failed migration messed everything up more and more).

However, I still can't access my IMAP server, the error persists with the error message as given in #1. In KMail's account, however, the exact error message is "Could not connect to the IMAP server. Could not read the password: User rejected wallet access."

Accessing the mail provider via POP3 (same password, also stored in KWallet) works flawlessly, however.

I still have no idea how to turn on a meaningfull logging.
Comment 5 Torgny Nyblom 2010-11-29 07:42:14 UTC
Strange, but I just saw that that logger strips all login credentials so it
would not work anyway :(

My guess would also be that the server interprets the %XX as a escape code that
transforms the "%XX" into another character. The question (I think) is if the
escaping from kimap is wrong or if the server is wrong in it's interpretation.
Hence it would be good if we could see what was sent to the server.

Wireshark dump?
Comment 6 wuselwu 2010-11-29 17:52:09 UTC
I think I have found the solution to the problem. 

With this IMAP-Server, Akonadi wrongly chooses STARTTLS as crypto method, and PLAIN instead of LOGIN. Manually switching the autodected values to SSL/TLS and LOGIN solves the problem.

So maybe it's rather a problem with the autodection of the IMAP server?
Comment 7 Torgny Nyblom 2010-11-30 11:51:01 UTC
That would depend on what the IMAP server replies to the CAPABILITIES command.
Comment 8 wuselwu 2010-12-02 05:14:32 UTC
As at least for my configuration the problem is fixed and seems to be more of a problem between the auto detection of features and the IMAP server, I close my report.