Bug 1866 - claws should make use of the IMAP 'deleted' flag
Summary: claws should make use of the IMAP 'deleted' flag
Status: RESOLVED FIXED
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: Folders/IMAP (show other bugs)
Version: 3.7.1
Hardware: PC All
: P3 enhancement
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2009-03-07 17:36 UTC by Vitus Jensen
Modified: 2009-04-03 18:53 UTC (History)
1 user (show)

See Also:


Attachments
patch to partly implement IMAP deletion modell (15.44 KB, patch)
2009-03-07 17:43 UTC, Vitus Jensen
no flags Details | Diff

Description Vitus Jensen 2009-03-07 17:36:18 UTC
Whenever a user deletes a message on an IMAP server the following should happen:

1) flag the message as 'deleted'
2) hide the message from view (optional)

Claws should NOT compact the folder the message resides in ('expunge') as this is not what the IMAP spec intends: https://mailman2.u.washington.edu/mailman/htdig/imap-use/2006-March/000118.html 

So the copying of a message to some "Trash" folder can be optional (default: off) for IMAP accounts saving bandwith and speeding up the deletion.  As a maintainance action there should be a "compact folder(s)" action, as a equivalent to "empty trash" for other mailbox accesses.
Comment 1 Vitus Jensen 2009-03-07 17:43:08 UTC
Created attachment 664 [details]
patch to partly implement IMAP deletion modell

This patch

- removes the 'expunge' commands from message deletion
- adds a 'compress_folder' method to _FolderClass which does the 'expunge'
- implements GUI elements to show/hide deleted messages

There are still issues
- delete removes messages from view (open/close folder to see messages)
- no GUI element to compress folders
Comment 2 Patrick O'Callaghan 2009-03-07 17:57:32 UTC
I agree with this proposal and urge its adoption, but would add that it would be even more useful if Claws supported a "virtual Trash" folder along the lines of Evolution. I can live without that though.

Note that "undeleting" messages would now simply involve removing the \Deleted flag.

Minor comment: the IMAP action for permanently removing mail is Expunge. "Compact folder" is an implementation-dependant synonym that makes literal sense when folders are stored as files but not otherwise; see for example several major IMAP servers such as Cyrus or Gmail.
Comment 3 Colin Leroy 2009-03-07 18:12:06 UTC
What I don't know is how moves between folders (which are copy+delete+expunge right now be handled). Copy+delete and no expunge? 

I have to say I hate this deletion-doesn't-delete model of IMAP. The patch will have to be great before I'd accept it :)
Comment 4 users 2009-03-30 19:21:37 UTC
Changes related to this bug have been committed.
Please check latest CVS and update the bug accordingly.
You can also get the patch from:
http://www.colino.net/claws-mail/

2009-03-30 [colin]	3.7.1cvs30

	* src/folder.c
	* src/folder.h
	* src/imap.c
	* src/mainwindow.c
	* src/mainwindow.h
	* src/prefs_account.c
	* src/prefs_account.h
	* src/summaryview.c
	* src/summaryview.h
		Fix bug 1866, 'Claws should make use of the IMAP 'deleted' flag'
		Add an option on the Receive page of IMAP account preferences:
		"Move deleted mails to trash and expunge immediately". This
		option defaults to TRUE to avoid changing the existing behaviour.
		Setting it to FALSE prevents automatic expunging. 
		Also, add Tools/Expunge and View/Hide deleted messages menu items
		(View/Hide deleted message being a per-folder setting, and behaving,
		like View/Hide read messages).
Comment 5 users 2009-03-30 19:23:51 UTC
Changes related to this bug have been committed.
Please check latest CVS and update the bug accordingly.
You can also get the patch from:
http://www.colino.net/claws-mail/

2009-03-30 [colin]	3.7.1cvs30

	* src/folder.c
	* src/folder.h
	* src/imap.c
	* src/mainwindow.c
	* src/mainwindow.h
	* src/prefs_account.c
	* src/prefs_account.h
	* src/summaryview.c
	* src/summaryview.h
		Fix bug 1866, 'Claws should make use of the IMAP 'deleted' flag'
		Add an option on the Receive page of IMAP account preferences:
		"Move deleted mails to trash and expunge immediately". This
		option defaults to TRUE to avoid changing the existing behaviour.
		Setting it to FALSE prevents automatic expunging. 
		Also, add Tools/Expunge and View/Hide deleted messages menu items
		(View/Hide deleted message being a per-folder setting, and behaving,
		like View/Hide read messages).
Comment 6 users 2009-03-30 19:24:11 UTC
Changes related to this bug have been committed.
Please check latest CVS and update the bug accordingly.
You can also get the patch from:
http://www.colino.net/claws-mail/

2009-03-30 [colin]	3.7.1cvs30

	* src/folder.c
	* src/folder.h
	* src/imap.c
	* src/mainwindow.c
	* src/mainwindow.h
	* src/prefs_account.c
	* src/prefs_account.h
	* src/summaryview.c
	* src/summaryview.h
		Fix bug 1866, 'Claws should make use of the IMAP 'deleted' flag'
		Add an option on the Receive page of IMAP account preferences:
		"Move deleted mails to trash and expunge immediately". This
		option defaults to TRUE to avoid changing the existing behaviour.
		Setting it to FALSE prevents automatic expunging. 
		Also, add Tools/Expunge and View/Hide deleted messages menu items
		(View/Hide deleted message being a per-folder setting, and behaving,
		like View/Hide read messages).
Comment 7 Colin Leroy 2009-03-30 19:30:25 UTC
2009-03-30 [colin]      3.7.1cvs30

        * src/folder.c
        * src/folder.h
        * src/imap.c
        * src/mainwindow.c
        * src/mainwindow.h
        * src/prefs_account.c
        * src/prefs_account.h
        * src/summaryview.c
        * src/summaryview.h
                Fix bug 1866, 'Claws should make use of the IMAP 'deleted' flag'
                Add an option on the Receive page of IMAP account preferences:
                "Move deleted mails to trash and expunge immediately". This
                option defaults to TRUE to avoid changing the existing behaviour.
                Setting it to FALSE prevents automatic expunging.
                Also, add Tools/Expunge and View/Hide deleted messages menu items
                (View/Hide deleted message being a per-folder setting, and behaving,
                like View/Hide read messages).

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