Bug 324219 - IMAP Folder Rename fails
Summary: IMAP Folder Rename fails
Status: RESOLVED FIXED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: IMAP resource (show other bugs)
Version: 4.11
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Kevin Ottens
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-29 12:40 UTC by Pierre
Modified: 2013-09-24 11:43 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.11.2


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre 2013-08-29 12:40:36 UTC
Renaming an IMAP folder in Kmail2 and akonadiconsole does not work. Managing IMAP mailfolders is severly hampered by this bug. In 4.10 it was still possible, also thunderbird has no problem renaming the same folder.

Reproducible: Always

Steps to Reproduce:
1. Right click on folder in Kmail2
2. Choose folder properties
3. edit name and click ok
Actual Results:  
The folder is not renamed. akonadi debugger shows:
NotificationManager::notify ( Collections ((207,.bla)) in collection 106 modified parts (timestamp, collectionannotations) )
NotificationManager::notify ( Collections ((207,.bla)) in collection 106 modified parts (NAME, collectionannotations) )
AgentBase(akonadi_imap_resource_1): Failed to write some annotations for 'bla1' on the IMAP server. SetAnnotation failed, server replied: A000345 NO Permission denied 
AgentBase(akonadi_imap_resource_1): Failed to write some annotations for 'bla1' on the IMAP server. SetAnnotation failed, server replied: A000346 NO Permission denied 
AgentBase(akonadi_imap_resource_1): Failed to write some annotations for 'bla1' on the IMAP server. SetAnnotation failed, server replied: A000347 NO Permission denied 
AgentBase(akonadi_imap_resource_1): Failed to write some annotations for 'bla1' on the IMAP server. SetAnnotation failed, server replied: A000348 NO Permission denied 
AgentBase(akonadi_imap_resource_1): Failed to rename the folder, restoring folder list.
NotificationManager::notify ( Collections ((207,.bla)) in collection 106 modified parts (NAME, collectionannotations) )

Expected Results:  
The folder is renamed.

Ubuntu 12.04, KDE 4.11 from backports, Cyrus IMAP-Server
Comment 1 Pierre 2013-09-13 11:34:04 UTC
imap log:
C: A000474 GETANNOTATION "INBOX.bla" "*" "value.shared"
S: * ANNOTATION INBOX.bla /vendor/cmu/cyrus-imapd/duplicatedeliver ( value.shared false )
S: * ANNOTATION INBOX.bla /vendor/cmu/cyrus-imapd/sharedseen ( value.shared false )
S: * ANNOTATION INBOX.bla /vendor/cmu/cyrus-imapd/pop3newuidl ( value.shared true )
S: * ANNOTATION INBOX.bla /vendor/cmu/cyrus-imapd/lastpop ( value.shared   )
S: * ANNOTATION INBOX.bla /vendor/cmu/cyrus-imapd/lastupdate ( value.shared 13-Sep-2013 13:29:16 +0200 )
S: * ANNOTATION INBOX.bla /vendor/cmu/cyrus-imapd/size ( value.shared 0 )
S: * ANNOTATION INBOX.bla /vendor/cmu/cyrus-imapd/partition ( value.shared default )
S: A000474 OK Completed
C: A000475 GETACL "INBOX.bla"
S: * ACL INBOX.bla p-ycgtae lrswipkxtecda
S: A000475 OK Completed
C: A000476 MYRIGHTS "INBOX.bla"
S: * MYRIGHTS INBOX.bla lrswipkxtecda
S: A000476 OK Completed
C: A000477 GETQUOTAROOT "INBOX.bla"
S: * QUOTAROOT INBOX.bla user.p-ycgtae
S: * QUOTA user.p-ycgtae ( STORAGE 20092 10000000 )
S: A000477 OK Completed
C: A000478 SETANNOTATION "INBOX.bla" "0" ("value.shared" "")
S: A000478 NO Permission denied
C: A000479 SETANNOTATION "INBOX.bla" "default" ("value.shared" "")
S: A000479 NO Permission denied
C: A000480 SETANNOTATION "INBOX.bla" "false" ("value.shared" "")
S: A000480 NO Permission denied
C: A000481 SETANNOTATION "INBOX.bla" "true" ("value.shared" "")
S: A000481 NO Permission denied
C: A000482 RENAME "INBOX.bla" "INBOX/bla1"
S: A000482 NO Invalid mailbox name
Comment 2 Daniel Vrátil 2013-09-14 15:00:48 UTC
There seem to be two problems in here:

1) You don't have privileges to do SETANNOTATION although the server announces full-write ACL (this could theoretically a server error) - maybe we could not fail the entire rename when SETANNOTATION failes

2) We use wrong separator when renaming the folder - server expects ".", we send "/"
Comment 3 Daniel Vrátil 2013-09-15 10:34:06 UTC
Found out that  1) is not a problem, 2) is the actual bug (I have a patch already)
Comment 4 Daniel Vrátil 2013-09-24 11:43:45 UTC
Git commit ed7a89ac5d45948114e7f15cba64972a9cf903a6 by Dan Vrátil.
Committed on 24/09/2013 at 09:55.
Pushed by dvratil into branch 'KDE/4.11'.

Fix support for IMAP servers with non-standard path separators

REVIEW: 112761
FIXED-IN: 4.11.2

M  +10   -0    resources/imap/imapresource.cpp
M  +3    -0    resources/imap/imapresource.h
M  +10   -23   resources/imap/resourcestate.cpp
M  +3    -1    resources/imap/resourcestate.h
M  +23   -1    resources/imap/resourcestateinterface.cpp
M  +4    -1    resources/imap/resourcestateinterface.h
M  +26   -6    resources/imap/resourcetask.cpp
M  +1    -0    resources/imap/resourcetask.h
M  +6    -0    resources/imap/retrievecollectionstask.cpp

http://commits.kde.org/kdepim-runtime/ed7a89ac5d45948114e7f15cba64972a9cf903a6