Bug 316153

Summary: can't move or delete messages in imap inbox
Product: [Applications] kmail2 Reporter: Justin Karneges <justin>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: CONFIRMED ---    
Severity: grave CC: allo, anmeldungen, arthur, billtsil, borden_c, charles, christoph.ruessler, cjlapao, cluebat, cookie170, demonocaquita, dharman, eiapopeia13, fd483721kde, felim, from-bugs-kde-org, gonssal, ilovekde, info, jer_blin, john, kde, kdebugs, kill, korgens, krombach, MurzNN, mybugtraqer, quazgar, rafaelalcantaraperez, reavertm, ryein, sebastien-devel, summerspam, t.m.guymer, tcberner, third-impact, valor, vincent+logiciels.kde, vo.zaeb, yasinzaehringer+kde, zsiraf, zucco.hero
Priority: NOR    
Version: 5.22.1   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=376156
Latest Commit: Version Fixed In:
Attachments: Screenshot

Description Justin Karneges 2013-03-05 06:57:30 UTC
If I drag mail from the inbox, it insists that I copy the mail and am given no choice to "move" the mail instead. Also, "move message to" and "move to trash" are grayed out in the right-click menu of a message. Previously I've experienced the problem many others have of being unable to move messages to the trash (due to not having a valid trash, or bad shortcut, etc), but the bug I'm reporting today seems different. This time I cannot even move messages to other folders, almost as if the inbox is "read only". Other folders do not have this problem. I can move mails out of other folders, and the menu options for move/trash are not grayed out on messages in those folders. It is only inbox.

Reproducible: Always

Steps to Reproduce:
1. Click on imap inbox to view messages of the inbox folder
2. Right-click a message, and observe that "move message to" is disabled
3.
Actual Results:  
Can't move messages.

Expected Results:  
Should be able to move messages.

Nothing special about the configuration. This is a fresh Ubuntu 12.10 with latest kmail, and when I setup an IMAP account this behavior was present immediately. I did not migrate kmail settings from a different computer.

Marking this as Grave since being able to delete messages (especially spam) is critical. Currently I run a separate email client connected to the same IMAP account specifically to delete emails from my inbox, while I use Kmail for everything else. Without a separate email client to assist, this bug would have made Kmail unusable to me.
Comment 1 Christian 2013-03-05 09:29:22 UTC
Can you delete the message without moving it to Trash first?
Comment 2 Justin Karneges 2013-03-05 10:14:51 UTC
Seems not. Delete (shift+del) does work from other folders though.
Comment 3 korgens 2013-04-27 03:22:25 UTC
The same thing is happening to me. I also can't find any indication of what is happening. This has already happened before in older versions of kmail. The only way to get kmail2 to work again was to delete the account , wipe out any traces of it in .kde and recreate them.

My version is:
Name           : kdepim-kmail
Version        : 4.10.2-2
Description    : Mail Client
Architecture   : x86_64

I'm using Archlinux.
Comment 4 Jan Sommer 2013-08-19 18:06:13 UTC
I have kind of the same problem in KMail with KDE SC 4.11 running with Kubuntu 12.04.

My inbox has subfolders for mailinglists, I can delete/move to trash mails from the subfolder, but not from the toplevel inbox folder. 

Is that the same bug  as described here or should I open a new bugreport?

See also this thread:
http://forum.kde.org/viewtopic.php?f=215&t=117097&p=290368#p290368
Comment 5 Sébastien Escudier 2013-08-19 18:48:08 UTC
I also have this bug.
I cannont delete or move messages from a top-level folder from my IMAP account.
All the others sub-folders work fine.
My trash folder is well configured.

I am using kmail and kde version 4.10.5
Comment 6 didi.debian 2013-12-27 15:06:28 UTC
I have this same issue on a freshly installed Debian Sid system with KDE SC 4.11.3.

I have no idea whether it's relevant, but the resource were created with server-side subscriptions enabled, but I've since disabled that.
Comment 7 Richard 2014-02-04 16:22:49 UTC
I can add on this. Created the IMAP account with server-side subscriptions enabled accidentially.  
Inbox, and only Inbox, not "writable". 
All folders below work normal and I can move mails in- and outside. 
Deleting the IMAP account from the list and re-adding it again without server-side subscriptions worked well - now also Inbox is writable. 
Maybe another fact is of importance (I actually do not know): on my mail server all folders reside as subfolders of "Inbox", so "Inbox" is the only top level folder.
Comment 8 cluebat 2014-02-20 20:02:56 UTC
I have the exact same issue. When I setup my IMAP account in KMail, I checked the box for server side subscriptions. Some IMAP clients I used long ago required the folders to be subscribed in order to see the contents so I just clicked that out of habit. For all intents and purposes, my Inbox was read-only but sub-folders thereof worked perfectly normal. I got directed to this bug after mentioning the issue on IRC.

me too, +1, etc with KMail 4.10.5

Removing the account and adding it again without server side subscriptions corrected the problem. I tried just toggling that from akonadiconsole without KMail running but that made no difference. It really must not be set when the account is made (or maybe not set ever) for KMail to work properly.

In case this is an issue with only some IMAP servers, my mail host runs Dovecot 2.2.10.  I'm guessing the server side subscriptions work on at least some servers or this bug that is almost a year old would have more comments and not be left in unconfirmed state. Let's figure out which servers it doesn't work on so maybe the KDE-PIM devs have some useful info with which to better investigate this. My mail host is running Dovecot 2.2.10. For the others that have reported and anyone else that may also be experiencing this, please state which IMAP server software (to the best of your knowledge) you or your mail host are using.
Comment 9 Jamey Campbell 2014-02-27 14:02:03 UTC
*** This bug has been confirmed by popular vote. ***
Comment 10 Marc González Majoral 2014-04-08 14:05:05 UTC
Can confirm this with version 4.12.3. It happened after the update from 4.11 to 4.12. Also a couple of emails from an account got copied like 50 times each to all the other IMAP accounts. A classic.
Comment 11 Allen Winter 2014-06-12 20:03:43 UTC
*** Bug 303284 has been marked as a duplicate of this bug. ***
Comment 12 Maciej Mrozowski 2014-06-12 20:11:37 UTC
I tried proposed workaround (re-add IMAP resource) but it worked only temporarily. After some time (haven't changed subscription settings!) it just went broken again.

I ever experienced the bug on home PC (gmail, Gentoo, latest released KDE) but I'm getting it all the time at work (Microsoft Exchange via IMAP, Fedora, latest KDE from "unstable" repo).

Kontact is the only email client with such problem (tried Thunderbird, Outlook Web Access and of course Outlook) so I'd rule out IMAP server issue here.

@Devs
Issue is permanent here and I'm quite frustrated, so let me know what kind of diagnistics I can provide to help debug this problem.
Comment 13 zucco.hero 2014-06-18 10:02:08 UTC
Kmail 4.13.0 (Kubuntu back port).
Delete or move message from IMAP Inbox folder removes message temporarly (cca 2 s) then it appears again as gray/shadow.
Message is not in Inbox in Akonadi (Akonadi Console -> Browser -> Inbox : I can see preview and next messages only, not the delete one).
The move message between non-Inbox (e.g. Archive to  Thrash on IMAP)  folder works well.
Comment 14 zucco.hero 2014-06-18 10:58:46 UTC
The deleted message reapears in Akonadi console after akonadictl restart. With the new Id and same Remote ID.
Comment 15 Maciej Mrozowski 2014-06-18 21:51:28 UTC
Let me guess - you have 'disconnected IMAP' enabled.
?
Comment 16 Allen Winter 2014-06-22 18:25:48 UTC
*** Bug 276853 has been marked as a duplicate of this bug. ***
Comment 17 Allen Winter 2014-06-22 18:26:18 UTC
*** Bug 291503 has been marked as a duplicate of this bug. ***
Comment 18 zucco.hero 2014-06-23 08:41:15 UTC
(In reply to comment #15)
> Let me guess - you have 'disconnected IMAP' enabled.
> ?

No, I'm sorry but haven't.
Comment 19 Félim Whiteley 2014-10-21 21:49:22 UTC
This is also effecting me as of last night, Kubuntu 14.04 with the latest backported KDE 4.14.2

- I'm not using disconnected IMAP.
- I use IMAP also on my phone, I deleted about 12 mails on my phone, one was still marked as unread, they now show above my Inbox folder in Kmail in the account folder for that account, parent folder... not sure what to call it.

- I get the following errors if I try to go into that folder or try to remove items from it: 
1. WT-Felim: Select failed, server replied: A007367 NO Client tried to access nonexistent namespace. ( Mailbox name should probably be prefixed with: INBOX. ) 
2. WT-Felim: Fetch failed, server replied: A007368 BAD No mailbox selected. 

On my phone or via web interface to my IMAP account it's not possible to go above the Inbox.

Is there any way via akonadis mysql interface or the like to remove these. It's a pain to remove the entire inbox. I had a look in the DB but there's too much for guesswork.
Comment 20 Félim Whiteley 2014-10-21 21:53:54 UTC
Sorry hit save before I was done...

I meant to add, I am unable to move or copy/delete any mail in the folder as I immediatly get a popup warning me it doesn't exist and the above errors.

Once I have clicked in here in general Kmail stops functioning correctly. Going into folders causes huge periods of busy indicator on the folder I have clicked on and the message list is blank for a very long time.

I am only using local subscriptions not server side.

I'll leave it in this state if there is anything you want me to do to help you trouble shoot it. It's annoying but not stopping me for the time being. I rather I could help you clear the bug.

Cheers,

Félim
Comment 21 Christo 2015-03-06 01:14:06 UTC
hi , i can confim this bug

opensuse 13.2
kmail 4.14.5-12.5
akonadi 4.14.5-12.5

messages stay greyed out while already moved into a different folder .. the file at its final destination works fine
Comment 22 mybugtraqer 2015-04-22 06:43:34 UTC
I confirm this bug

Arch, -Syu'ed today
Kmail 4.14.7
Comment 23 Klaus 2015-10-24 13:21:27 UTC
Created attachment 95104 [details]
Screenshot

I confirm must this bug too :-(

I got this issue since I did an upgrade to Kubuntu 15.10 yesterday !

Kmail 5.0.2
Kubuntu 15.10

Upgraded from Kubuntu 15.04 with Plasma 5.3 from backports PPA. Until now everthing (KMail) worked fine!
Comment 24 Vasilis Tsiligiannis 2015-10-26 19:21:21 UTC
I've been hit from the same bug Klaus did. But I suspect that this is different than the original. Also Akonadi console does not even show any entries for any resource in the browser.
Comment 25 Gauss 2015-10-27 08:41:29 UTC
I can also confirm "this" bug, while a bit different then in the original report.
I can move mails between folders, but the delete aka purge function does not seem to work. Deleted mails are greyed out and can neither be selected nor purged within kmail.
The mails are marked as deleted (in my IMAP webinterface), however purge is not being called, although the folder compression option to purge deleted mails is checked in the settings.

!!!!!!!!!
This bug is particularly grave when combined with mail filtering. The filter first moves the mail to another folder, but cannot purge it. The next times the filter is called that non-purged mail is again filtered and moved to that folder. So each time the filter is called, in the target folder there is the original mail plus nFilterCalls x the non-purged mail. The account basically explodes if many big mails are received and the filter is called often.
!!!!!!!!!

If I go to my IMAP web interface and manually purge the deleted mails everything is fine again... until new mails arrive. So the only thing I can do is disable my filters, thus this bug actually breaks a lot more features!

The bug exists since an upgrade from Ubuntu 15.04 to 15.10, Kmail version is 5.0.2
Comment 26 Marc González Majoral 2015-10-27 14:33:03 UTC
I confirm the same problem as Gauss after upgrading to 15.10. Really annoying.
Comment 27 Kim Lilliestierna 2015-11-01 16:42:58 UTC
Bug confirmed on Kubuntu 15.10 as well, would humbly appreciate a patch for this rather sooner than later, spam filtering is currently a paradox, since it is constantly doubling the spam int the "Spam" folder :), so for now have to turn of automatic filtering
Comment 28 Marc González Majoral 2015-11-07 11:18:46 UTC
Just in case it helps someone, I managed to fix it by installing Thunderbird and configuring the affected IMAP accounts. I'm not joking nor being sarcastic. After accessing any of the accounts in Thunderbird, they work fine in kmail again.
Comment 29 Klaus 2015-11-08 13:43:13 UTC
@Marc González Majoral:
Thanks for your suggestion. But it's only a temporary solution. It repairs the entries in the main folder and not in the subfolders. And after some time, when new messages  coming up, the problem appears again. But thanks anyway.

I dont know if it's KDE or a Kubuntu problem. Cause only Kubuntu users seems to be affected.
Comment 30 Zsiráf 2015-11-09 14:36:02 UTC
I confirm this bug.
When I move or delete an email from IMAP folder, it removes for temporarily, but the message reappear as gray/shadow.

It's on openSUSE Leap, KMail 5.0.2, akonadi 15.08
Comment 31 Kim Lilliestierna 2015-11-09 22:44:42 UTC
Mucked around a bit with this, I have access to 2 different imap servers on is a Dovecot the other A Courier, it works ok on the Dovecot not  on the Courier,
After enabling debugging on the akonadi IMAP resource i see one very important difference:
on the Dovecot case the EXPUNGE command is sent regularly, on the Courier it does not. This explains the behavior: Deleting a message in IMAP only marks it as \DELETED but it still exists and Kmail vill act upon it as if it where a regular message, to really get rid of the message a EXPUNGE command need to be sent to the IMAP server for the folder in question. Moving a file entails first copying it and then deleting the original.
And since the original only gets marked and Kmail is a bit stupid there, any auto scripts that you might be running goes nuts with the moving.
I asume that the above 1/2 solution with an alternate mail client works since they probably send of the EXPUNGE and cleans out the crap :)
So why the different behavior on different servers?, im guessing some (not) so smart decision is being made based on the servers capability report.
 
So, either add a "force EXPUNGE" command/button/menu entry/whatever and have Kmail ignore mails with the \DELETED flag set, at the least when scripts are running.
Comment 32 Jan 2015-11-15 08:16:55 UTC
Seems like the bug is reported at launchpad too:
 https://bugs.launchpad.net/ubuntu/+source/kdepim/+bug/874468
Comment 33 Yasin Zähringer 2015-11-16 00:46:57 UTC
While investigating a different issue I found a workaround (which however does not address the root cause):
start the akonadi console, select the browser tab and find the affected inbox. Right click on it and select folder properties. Now you find a tab called ACL and where probably all check boxes are deselected. I checked all boxes except the two boxes of the second row (link,unlink) because a subfolder also had these boxes unchecked. After I restarted KMail, I was finally able to move mails again.
Comment 34 Zsiráf 2015-11-16 12:09:10 UTC
(In reply to Yasin Zähringer from comment #33)
> start the akonadi console, select the browser tab and find the affected
> inbox. Right click on it and select folder properties. Now you find a tab
> called ACL and where probably all check boxes are deselected.
All boxes was selected (except link and unlink) but delete or move doesn't work.
Comment 35 Carlos Lapao 2015-11-27 09:47:23 UTC
(In reply to Yasin Zähringer from comment #33)
> While investigating a different issue I found a workaround (which however
> does not address the root cause):
> start the akonadi console, select the browser tab and find the affected
> inbox. Right click on it and select folder properties. Now you find a tab
> called ACL and where probably all check boxes are deselected. I checked all
> boxes except the two boxes of the second row (link,unlink) because a
> subfolder also had these boxes unchecked. After I restarted KMail, I was
> finally able to move mails again.

Same here, followed this advice and still can't move or delete messages, they will all be grayed out
Comment 36 Jan 2015-11-30 06:26:39 UTC

*** This bug has been marked as a duplicate of bug 354056 ***
Comment 37 Caqui 2016-03-31 14:49:03 UTC
(In reply to Jan from comment #36)
> 
> 
> *** This bug has been marked as a duplicate of bug 354056 ***

I think this bug is NOT a duplicate of that one. In this bug there are no greyed-out messages, you just cannot delete them (the option "Move to Wastebin" is the only thing greyed-out), and you couldn't, ever.

(In reply to cluebat from comment #8)
> I have the exact same issue. When I setup my IMAP account in KMail, I
> checked the box for server side subscriptions. Some IMAP clients I used long
> ago required the folders to be subscribed in order to see the contents so I
> just clicked that out of habit. For all intents and purposes, my Inbox was
> read-only but sub-folders thereof worked perfectly normal. I got directed to
> this bug after mentioning the issue on IRC.
> 
> me too, +1, etc with KMail 4.10.5
> 
> Removing the account and adding it again without server side subscriptions
> corrected the problem. I tried just toggling that from akonadiconsole
> without KMail running but that made no difference. It really must not be set
> when the account is made (or maybe not set ever) for KMail to work properly.
> 
> In case this is an issue with only some IMAP servers, my mail host runs
> Dovecot 2.2.10.  I'm guessing the server side subscriptions work on at least
> some servers or this bug that is almost a year old would have more comments
> and not be left in unconfirmed state. Let's figure out which servers it
> doesn't work on so maybe the KDE-PIM devs have some useful info with which
> to better investigate this. My mail host is running Dovecot 2.2.10. For the
> others that have reported and anyone else that may also be experiencing
> this, please state which IMAP server software (to the best of your
> knowledge) you or your mail host are using.

As cluebat says, the only WORKAROUND I found is deleting completely the account and then configuring it again without checking server-side subscriptions. If you click it once, ever, you get the bug forever.
Comment 38 Ryein Goddard 2016-05-11 19:50:00 UTC
I agree this bug is not a duplicate.  It is different.

I am also running into this issue with an imap account on a cpanel server.

I cannot delete items in the Inbox folder.
Comment 39 Murz 2016-12-22 13:15:04 UTC
I got the same problem on Kmail 4:4.14.3-0ubuntu1~ubuntu14.04~ppa3
Comment 40 Murz 2016-12-22 13:15:50 UTC
And this is not duplicate of bug 354056, this is totally different problem.
Comment 41 Andrej M. 2017-03-04 06:18:35 UTC
I wasn't affected by this bug in previous KMail versions (applications 4.14.1 and lower) but now in 16.04.3 (Kontact 5.2.3) it's here and it's extremely annoying.

Restarting akonadi doesn't help.
Restarting KMail doesn't help, however, the Move option is active for a fraction of the second and then becomes inactive.

Only thing that helps for a while is recreating the account, but I want to use the program to read mails not to reconfigure it all the time.

As this is certainly not resolved please reopen it.

Best regards,
Andrej
Comment 42 Alexander 2017-03-06 11:38:35 UTC
(In reply to Andrej M. from comment #41)
> I wasn't affected by this bug in previous KMail versions (applications
> 4.14.1 and lower) but now in 16.04.3 (Kontact 5.2.3) it's here and it's
> extremely annoying.
> 
> Restarting akonadi doesn't help.
> Restarting KMail doesn't help, however, the Move option is active for a
> fraction of the second and then becomes inactive.
> 
> Only thing that helps for a while is recreating the account, but I want to
> use the program to read mails not to reconfigure it all the time.
> 
> As this is certainly not resolved please reopen it.
> 
> Best regards,
> Andrej

I'm not sure that the maintainers read new comments to closed discussions. So I opened a new bug report: https://bugs.kde.org/show_bug.cgi?id=376156 

Without any reaction, yet.
Comment 43 eiapopeia13 2017-05-12 08:27:30 UTC
(In reply to Yasin Zähringer from comment #33)
> While investigating a different issue I found a workaround (which however
> does not address the root cause):
> start the akonadi console, select the browser tab and find the affected
> inbox. Right click on it and select folder properties. Now you find a tab
> called ACL and where probably all check boxes are deselected. I checked all
> boxes except the two boxes of the second row (link,unlink) because a
> subfolder also had these boxes unchecked. After I restarted KMail, I was
> finally able to move mails again.

This worked for me too. (Kubuntu 16.04, Plasma 5, KMail 5.1.3)
Thank you!
Comment 44 Allan Sandfeld 2017-09-26 09:12:30 UTC
I had this issue on one machine and could solve it by adjusting ACL. Now I have it on a new installation but this time the ACLs are all fine?
Comment 45 Alex 2018-01-26 22:54:17 UTC
Still a problem in KMail 5.6.3 (Debian buster)
Comment 46 Viktor Maksimov 2018-08-13 05:21:34 UTC
Problem actual for version kmail 5.2.3 (Debian buster)
Comment 47 Viktor Maksimov 2018-08-13 05:22:34 UTC
Problem actual for version kmail 5.2.3 (Debian buster)
Comment 48 quazgar 2022-01-06 13:42:27 UTC
I experience the problem in Debian Buster as well (5.9.3), setting ACLs in akonadiconsole also worked as a workaround for me. The IMAP account in question was one from uberspace.de.
Comment 49 dharman 2022-07-07 14:23:32 UTC
(In reply to eiapopeia13 from comment #43)
> (In reply to Yasin Zähringer from comment #33)
> > While investigating a different issue I found a workaround (which however
> > does not address the root cause):
> > start the akonadi console, select the browser tab and find the affected
> > inbox. Right click on it and select folder properties. Now you find a tab
> > called ACL and where probably all check boxes are deselected. I checked all
> > boxes except the two boxes of the second row (link,unlink) because a
> > subfolder also had these boxes unchecked. After I restarted KMail, I was
> > finally able to move mails again.
> 
> This worked for me too. (Kubuntu 16.04, Plasma 5, KMail 5.1.3)
> Thank you!

This seems fixing the problem in Kubuntu 22.04 too. Thank you!
Comment 50 Gunter Ohrner 2022-11-13 08:38:35 UTC
I can confirm this bug / issue in 

KMail
Version 5.21.3 (22.08.3)

KDE Frameworks 
Version 5.99.0

Qt 
Version 5.15.7 (kompiliert gegen 5.15.6)

Das Fenstersystem xcb
Comment 51 Gunter Ohrner 2022-11-13 08:44:57 UTC
(In reply to Yasin Zähringer from comment #33)
> start the akonadi console, select the browser tab and find the affected
> inbox. Right click on it and select folder properties. Now you find a tab
> called ACL and where probably all check boxes are deselected. I checked all
> boxes except the two boxes of the second row (link,unlink) because a
> subfolder also had these boxes unchecked. After I restarted KMail, I was
> finally able to move mails again.

Thanks, this workaround also seemst to work for me in KMail Version 5.21.3 (22.08.3).

However the info text below these boxes explicitly warns against changing them manually, so I hope I don't cause and further trouble down the road by this change.

In any case, it's necessary because an Inbox from where you cannot delete anything, and cannot move any message out of it just plain unusable... :-(
Comment 52 fdkde 2023-01-15 12:01:53 UTC
(In reply to Yasin Zähringer from comment #33)
> While investigating a different issue I found a workaround (which however
> does not address the root cause):
> start the akonadi console, select the browser tab and find the affected
> inbox. Right click on it and select folder properties. Now you find a tab
> called ACL and where probably all check boxes are deselected. I checked all
> boxes except the two boxes of the second row (link,unlink) because a
> subfolder also had these boxes unchecked. After I restarted KMail, I was
> finally able to move mails again.

Thanks for the workaround, but it is only working temporarily - at least for me on Version 5.22.1 (22.12.1). Everytime I create a new folder in my IMAP account, the issue reappears and the ACL changes are getting reverted to the previous settings.
Comment 53 Borden 2023-01-18 23:20:30 UTC
It would appear, once again, that Akonadi is to blame for perpetually messing up the ACLs?