Bug 288032 - Inbox is Missing for IMAP folders
Summary: Inbox is Missing for IMAP folders
Status: RESOLVED FIXED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: IMAP resource (show other bugs)
Version: 1.0.0
Platform: Ubuntu Linux
: NOR major
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-02 05:46 UTC by Blackpaw
Modified: 2011-12-27 22:38 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.8


Attachments
IMAP log of Sync and Server Side Sub Dialog (29.73 KB, text/plain)
2011-12-02 09:19 UTC, Blackpaw
Details
2nd log file (1.33 KB, application/octet-stream)
2011-12-02 09:20 UTC, Blackpaw
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Blackpaw 2011-12-02 05:46:45 UTC
Version:           1.99.0 (using Devel) 
OS:                Linux

I have a IMAP (not dIMAP) account setup to a MDaemon 9.5.6 Mail Server - the Inbox does not display and is not visible in Local Subscriptions.

However it is visible in Server side Subscriptions and can be checked, but doesn't stay checked - when I go back into Server Side Subscriptions it is unchecked again.


If I disable server side subscriptions it does become visible in local subscriptions and email is synced to it.

Reproducible: Always

Steps to Reproduce:
Setup a IMAP connection with my IMAP server

Actual Results:  
Inbox not visible (all other folders are)

Expected Results:  
Inbox should appear

OS: Linux (i686) release 3.0.0-13-generic
Compiler: gcc
Comment 1 Blackpaw 2011-12-02 05:54:08 UTC
I can setup a test account and enable remote access on request
Comment 2 András Manţia 2011-12-02 07:23:50 UTC
export KIMAP_LOGFILE=/tmp/imap.log
restart akonadi: akonadictl restart
select the inbox in kmail
look at the imap log files and paste the part when it selects the inbox (you can paste everything but the login data).

Or you could do a sync of the account and paste the output after.
Comment 3 Blackpaw 2011-12-02 08:05:31 UTC
How can I select the Inbox when its not visible?
Comment 4 András Manţia 2011-12-02 08:13:12 UTC
Ah, sorry, I misunderstand (thought INBOX content is not visible). Please do the sync only and also bring up the server side subscriptiion dialog so that gets logged as well.
Comment 5 Blackpaw 2011-12-02 09:19:58 UTC
Created attachment 66293 [details]
IMAP log of Sync and Server Side Sub Dialog

Main Log file
Comment 6 Blackpaw 2011-12-02 09:20:45 UTC
Created attachment 66294 [details]
2nd log file

This was created as well, seems somewhat smaller though

Let me know if you need anything else.
Comment 7 András Manţia 2011-12-02 11:39:20 UTC
The only problem that I can see is this:

C: A000004 LIST "" *
S: * LIST ( ) / INBOX


C: A000033 LSUB "" *
S: * LSUB ( ) / Inbox


So for listing, it gives INBOX and when querying for subsribed folders, it gives Inbox.
I have to check the code and the RFC, and will come back later.
Comment 8 András Manţia 2011-12-02 11:54:21 UTC
Please test the following:
- run kdebugdialog and enable the debug area for akonadi_imap_resource_X (X is your number)
- in the same console restart akonadi
- start kmail
- check if the debug output has anything like this:

Got phantom mailbox: Inbox

If unsure, attach the debug output (check that it has no sensitive information first)
Comment 9 Blackpaw 2011-12-02 12:18:42 UTC
kdebugdialog didn't have a entry akonadi_imap_resource_0 (or any imap resource), but the console utput on restart did have the following:

akonadi_imap_resource_0(32145) RetrieveCollectionsTask::onMailBoxesReceived: Got phantom mailbox:  "Inbox"
Comment 10 Blackpaw 2011-12-02 13:46:22 UTC
From the RFC:

  http://www.ietf.org/rfc/rfc1730.txt

  mailbox         ::= "INBOX" / astring
                       ;; INBOX is case-insensitive; other names may be
                       ;; case-sensitive depending on implementation.
Comment 11 András Manţia 2011-12-02 22:03:05 UTC
Git commit dadd1d7e23e38021c15b8193f2b975ce6bc3bd84 by Andras Mantia.
Committed on 02/12/2011 at 23:02.
Pushed by amantia into branch 'master'.

Fix Inbox listing in the case when LIST returns INBOX, but LSUB returns Inbox. This is allowed by RFC, Inbox is case-insensitive.
Add a unit test for it.
BUG: 288032

M  +18   -2    resources/imap/retrievecollectionstask.cpp
M  +8    -0    resources/imap/retrievecollectionstask.h
M  +24   -0    resources/imap/tests/testretrievecollectionstask.cpp

http://commits.kde.org/kdepim-runtime/dadd1d7e23e38021c15b8193f2b975ce6bc3bd84
Comment 12 András Manţia 2011-12-02 22:37:09 UTC
Git commit a98b598c195d174445595d2849b0ad3e3f70d38f by Andras Mantia.
Committed on 02/12/2011 at 23:31.
Pushed by amantia into branch 'master'.

Fix Inbox listing: Inbox should be case insensitive, so always return INBOX.
This makes the life of clients easier, as they don't need to do the conversion every time.
Add a unit test for it.
CCBUG: 288032

M  +12   -0    kimap/listjob.cpp
M  +8    -0    kimap/listjob.h
M  +54   -0    kimap/tests/listjobtest.cpp

http://commits.kde.org/kdepimlibs/a98b598c195d174445595d2849b0ad3e3f70d38f
Comment 13 András Manţia 2011-12-02 22:37:21 UTC
Git commit 47a57f616f0e7c2ceaf53f0e4028184ba18f8822 by Andras Mantia.
Committed on 02/12/2011 at 23:36.
Pushed by amantia into branch 'master'.

Partly revert dadd1d7e23e38021c15b8193f2b975ce6bc3bd84 as I do the INBOX name conversion it in KIMAP instead,
as it is needed in other places as well. Leave the unit test in place.
Needs kdepimlibs with commit 6be0e6ea9e1a49cbdf09a6c273a9ea1a1f5da375.
CCBUG: 288032

M  +1    -17   resources/imap/retrievecollectionstask.cpp
M  +0    -8    resources/imap/retrievecollectionstask.h

http://commits.kde.org/kdepim-runtime/47a57f616f0e7c2ceaf53f0e4028184ba18f8822
Comment 14 Blackpaw 2011-12-23 22:19:43 UTC
This bug is back - exact same behaviour, using Kubuntu 11.10 beta repo, KMail 4.6 Beta 2 (4.7.90)
Comment 15 András Manţia 2011-12-27 20:55:36 UTC
I tried with today's git master version, and I don't see the bug with the server you provided the access (nor I saw it in the past month as I still have that account configured to test other things, like folder sorting :) ).
I even added a new account to see how it behaves, and everything looks fine.

I don't know what goes wrong there. Are you subscribed correctly to Inbox? Does kubuntu package the right version as 4.8Beta2 and not 4.7.x (where x is of course not 90) ?
Comment 16 Blackpaw 2011-12-27 22:38:34 UTC
Was just going to correct it today - kubuntu has updated to 4.8RC and its now working again. So all good

Thanks - Lindsay