Bug 338672

Summary: Can't create folder on IMAP server
Product: [Applications] kmail2 Reporter: Volker Kuhlmann <bugz57>
Component: foldersAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: bugs.kde.org, bugz57, kdenis, montel
Priority: NOR    
Version: 4.10.5   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
URL: imap://posteo.de
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Volker Kuhlmann 2014-08-30 04:09:34 UTC
Creating a new folder on the IMAP server using the posteo.de web interface works fine and the new folder shows up in kmail (receiving account) after a refresh (ctrl-F5).

Creating a folder for this IMAP account at the top level in kmail produces error: "Posteo: Could not create collection Test resourceId: 34". This message is repeated frequently, on each kmail startup, and flooded through the panel's notifications facility (very irritating). The top-level folder is actually created on the IMAP server.

From then on kmail will not show any new folders or sub-folders created on the server, e.g. with the server's webmail interface.

Subfolders can still be created with kmail, and show up in kmail and are created on the server.

kmail is then permanently stuck, stopping akonadi and quitting kmail does NOT change this.
The only way to fix this is to delete the receive account in kmail (or system settings, personal information), and to re-create it.

I haven't found similar bug reports in bugzilla.

Workaround: Only perform creation of folders in posteo's webmail interface!!

Reproducible: Always

Steps to Reproduce:
1. Create a receive account in kmail for posteo.de
2. Add a new folder in the IMAP account on posteo.de at the top level - RMB on the IMAP service name in kmail's folder list (the server icon), with the name containing only ASCII characters.
3.
Actual Results:  
* kmail produces an error: Posteo: Could not create collection Test resourceId: 34
* The folder is not shown in kmail (although it is created on the server).
* No further folder or sub-folders created on the server will show in kmail.
* Frequent notification drivel occurs.
* Restarting akonadi and kmail does not fix it.
* Sub-folders can still be created in kmail, and are shown as expected.


Expected Results:  
Folder is created. Folder shows in kmail. Further folder or sub-folder creation, either with kmail or otherwise, is possible and all folders created on the server show in kmail after refresh.

System is running on US or UK English locale. IMAP server is probably running on German locale.

IMAP server's web interface shows folders Posteingang, Entwürfe, Gesendet, Gelöscht (which can't be deleted etc). kmail translates this into English, and does not associate Gelöscht with what it calls Trash.

The problem does not occur with gmx.de.
Comment 1 Volker Kuhlmann 2014-08-30 04:15:31 UTC
When starting kmail from the console while akonadi is stopped, this shows up in between screefuls of stuff:

Error during executing query "INSERT INTO CollectionTable (remoteId, remoteRevision, name, parentId, resourceId, cachePolicyInherit, isVirtual) VALUES (:0, :1, :2, :3, :4, :5, :6)" :  "Duplicate entry '540-Test' for key 'CollectionTable_parentAndNameIndex' QMYSQL3: Unable to execute statement"

Is kmail trying to create an entry twice, and also not noticing on restarts/refreshes that it already exists?
Comment 2 Volker Kuhlmann 2014-08-30 22:30:23 UTC
All of these operations, creating/deleting a top-level folder with non-ASCII characters in the name, work flawlessly in kmail with gmx.de.
Even in case posteo.de's IMAP server is not as it should be, being able to recover from the problem only by deleting the akonadi IMAP resource looks like a bug in kmail (akonadi?).
Comment 3 Laurent Montel 2014-08-31 06:50:23 UTC
4.10.5 is very old.
Did you test in new version.
I remember that it was fixed .
Comment 4 Tom Chiverton 2015-02-22 10:13:56 UTC
It's not fixed. Still happens with latest KDE releases, see #292418 (marked fixed, isn't).
Comment 5 Denis Kurz 2017-01-14 15:06:51 UTC
The option to create top-level folders seems to have been removed. Right-clicking on the account in the folder list, KMail does not offer that option. Selecting the account in the folder list, the option to create a new subsolder in the Folders menu of KMail is greyed out. Both ways to add new folders work on any other folder.

My setup: KMail 5.4.1, and posteo.de, too. Posteo still let's me create top-level folders via the web interface.

I'm not sure whether this bug is valid anymore. It was about crashes when using a feature that is now gone.
Comment 6 Tom Chiverton 2017-01-14 15:13:50 UTC
It's not meant to be gone. Creating top level folders is standard imap feature.
Comment 7 Denis Kurz 2017-01-14 15:22:04 UTC
Yes, you are right. This bug, however, wasn't about a missing feature, essential as it may be, but about a bug that was triggered by the feature when it was still present. Mixing up different bugs in a single report can make it even harder to track the bug down, so I'd like to avoid it. You never know which parts are confirmed by new comments.
Comment 8 Tom Chiverton 2017-06-11 08:31:31 UTC
Fixed in latest KDE Neon release (5.5.2)