Bug 3804 - Better handling of deleting a non-existent IMAP folder
Summary: Better handling of deleting a non-existent IMAP folder
Status: NEW
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: Folders/IMAP (show other bugs)
Version: 3.13.2
Hardware: PC Linux
: P3 enhancement
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2017-04-06 01:55 UTC by Pd
Modified: 2017-04-06 21:38 UTC (History)
0 users

See Also:


Attachments

Description Pd 2017-04-06 01:55:49 UTC
I use CM and Outlook (Web Access).  I deleted a folder on the server using Outlook, and then tried to delete the same folder in CM, but get the error "Can't remove the folder XXXX".

The funny thing is, the network log says this:

[16:53:11] IMAP4< * STATUS Tasks (MESSAGES 0 UIDNEXT 1 UIDVALIDITY 70 UNSEEN 0)  
[16:53:11] IMAP4< 15 OK STATUS completed. 
[16:53:16] IMAP4> 16 UNSUBSCRIBE "Impersonal emails/XXX" 
[16:53:16] IMAP4< 16 OK UNSUBSCRIBE completed. 
[16:53:16] IMAP4> 17 DELETE "Impersonal emails/XXX" 
[16:53:16] IMAP4< 17 NO The requested item could not be found. 
** IMAP error on ballard.amazon.com: DELETE error
[16:53:16] IMAP4> 18 DELETE "Impersonal emails/XXX/" 
[16:53:16] IMAP4< 18 NO The requested item could not be found. 
** IMAP error on ballard.amazon.com: DELETE error
** can't delete mailbox
[16:53:16] IMAP4> 19 SELECT "Impersonal emails/XXX" 
[16:53:16] IMAP4< 19 NO "Impersonal emails/XXX" doesn't exist. 
** IMAP error on ballard.amazon.com: SELECT error
** can't select folder: Impersonal emails/XXX

In short, I can't delete the folder because it doesn't exist.
Comment 1 Pd 2017-04-06 01:58:47 UTC
Apparently, if I unsubscribe from the folder first, then I can delete it.
Comment 2 Andrej Kacian 2017-04-06 10:40:11 UTC
Function imap_remove_folder_real() could be improved:

If the DELETE command gets a NO response, check whether the folder exists on server side (STATUS, LIST or LSUB command, probably the first one to make it simple), and if not, just continue with cleanup on client side as if DELETE succeeded.



(In reply to comment #1)
> Apparently, if I unsubscribe from the folder first, then I can delete it.

Could please you post the protocol log from this action too?
Comment 3 Pd 2017-04-06 21:38:41 UTC
Apologies, but today I created a folder in CM, deleted it with OWA, and then successfully deleted it in CM.

I'm pretty sure I could reproduce the error by deleting one of my other long-lived folders (created at the same time and in the same way as the problem folders), but they've got lots of mail in them and I've got them set up with tons of filtering rules.  I really don't want to delete them.  :-/

In short, I'm not sure how to reproduce the problem now.

Is there an easy way to show every property about a folder on the imap server AND in CM?  Then I could create a new folder and tweak it until it exactly matches an existing folder except for the name.  Hopefully that should reproduce the problem.

Thanks.

Note You need to log in before you can comment on or make changes to this bug.