Bug 1855985 Comment 3 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Shawn Heisey from comment #0)
> User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0
> 
> Steps to reproduce:
> 
> Either permanently delete messages or send messages to Trash and then empty Trash.

The trash folder is sent an imap expunge command when you empty trash so the server should permanently delete the messages there. I'm seeing it happen in IMAP:4 log when I do do empty trash.

If I do a shift-delete on a message that would normally go to trash, the message just gets marked with the imap \deleted flag and is not completely/permanently removed (expunged) from the server and will even be visible but crossed out if you set tb delete mode "just mark as deleted".

Is Roundcube showing the marked \deleted message as normal messages or does it indicate they are marked deleted such has showing them crossed out?  I don't have Roundcube to test this myself.
I found this link that implies Roundcube shows messages marked deleted by outlook (and probably TB) as crossed out: https://www.roundcubeforum.net/index.php?topic=2817.0

Item 1 "Purge immediately on message delete", controlled by ```mail.imap.expunge_after_delete ```, just expunges your folder when you mark \deleted a message. This may be OK if the folder isn't shared by more than one client (a major purpose for imap) it might be better if after TB marks a message \deleted, instead of folder expunge, it then did a UID expunge on the message and not expunge what you might not want removed if you have more than one client/user sharing the folder. However, UID expunge is only available on servers with UIDPLUS capability, but most servers now have that.

There's another feature that tries to run a folder expunge if more than 20 messages get marked deleted in a folder. It's controlled by ```mail.imap.expunge_threshold_number``` which defaults to 20. It can be shut off if you don't want any auto-expunge by setting ```mail.imap.expunge_option``` to 3. Specifically, with comments taken from the code and edited some:
```
// let delete model control expunging, i.e., don't ever expunge when the
// user chooses the imap delete model (i.e., just mark deleted), otherwise, expunge when over the
// threshold when new messages fetched for folder. This is the default TB behavior.
mail.imap.expunge_option = 0;  // default

// Expunge whenever the folder is selected regardless of delete model or number
// of marked deleted messages present in the folder and new messages are fetched.
 mail.imap.expunge_option = 1;

// Expunge when over the threshold on folder selection with new messages, independent of the delete model.
mail.imap.expunge_option  = 2;

// Set mail.imap.expunge_option to kAutoExpungeNever to NEVER do an auto-
// expunge. This is useful when doing a bulk transfer of folders and messages
// between imap servers.
mail.imap.expunge_option = 3;
```
The last expunge_option = 3 was added as part of bug 1828372. This also removed places where an imap CLOSE occurs since it causes messages to be expunged unexpectedly when folders are shared clients and is described here: bug 1739833.  This is likely the main reason the reporter is seeing a difference with earlier TB versions.

Note also that you can "compact" an mbox folder at any time which will do an imap folder expunge. However, this is not currently possible with imap accounts configured with maildir as described here: bug 1827973.

Note also, I haven't addressed the issue with folder compacting based on the amount of disk space it would free up in the mbox or maildir files, as mentioned in comment 2. I think that's a subject of another bug.
(In reply to Shawn Heisey from comment #0)
> User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0
> 
> Steps to reproduce:
> 
> Either permanently delete messages or send messages to Trash and then empty Trash.

The trash folder is sent an imap expunge command when you empty trash so the server should permanently delete the messages there. I'm seeing it happen in IMAP:4 log when I do do empty trash.

If I do a shift-delete on a message that would normally go to trash, the message just gets marked with the imap \deleted flag and is not completely/permanently removed (expunged) from the server and will even be visible but crossed out if you set tb delete mode "just mark as deleted".

Is Roundcube showing the marked \deleted message as normal messages or does it indicate they are marked deleted such has showing them crossed out?  I don't have Roundcube to test this myself.
I found this link that implies Roundcube shows messages marked deleted by outlook (and probably TB) as crossed out: https://www.roundcubeforum.net/index.php?topic=2817.0

Item 1 "Purge immediately on message delete", controlled by ```mail.imap.expunge_after_delete ```, just expunges your folder when you mark \deleted a message. This may be OK if the folder isn't shared by more than one client (a major purpose for imap) it might be better if after TB marks a message \deleted, instead of folder expunge, it then did a UID expunge on the message and not expunge what you might not want removed if you have more than one client/user sharing the folder. However, UID expunge is only available on servers with UIDPLUS capability, but most servers now have that.

There's another feature that tries to run a folder expunge if more than 20 messages get marked deleted in a folder. It's controlled by ```mail.imap.expunge_threshold_number``` which defaults to 20. It can be shut off if you don't want any auto-expunge by setting ```mail.imap.expunge_option``` to 3. Specifically, with comments taken from the code and edited some:
```
// Let delete model control expunging, i.e., don't ever expunge when the
// user chooses the imap delete model (i.e., just mark deleted), otherwise, expunge when over the
// threshold when new messages fetched for folder. This is the default TB behavior.
mail.imap.expunge_option = 0;  // default

// Expunge whenever the folder is selected regardless of delete model or number
// of marked deleted messages present in the folder and new messages are fetched.
 mail.imap.expunge_option = 1;

// Expunge when over the threshold on folder selection with new messages, independent of the delete model.
mail.imap.expunge_option  = 2;

// Set mail.imap.expunge_option to kAutoExpungeNever to NEVER do an auto-
// expunge. This is useful when doing a bulk transfer of folders and messages
// between imap servers.
mail.imap.expunge_option = 3;
```
The last expunge_option = 3 was added as part of bug 1828372. This also removed places where an imap CLOSE occurs since it causes messages to be expunged unexpectedly when folders are shared with other clients and is described here: bug 1739833.  This is likely the main reason the reporter is seeing a difference with earlier TB versions.

Note also that you can "compact" an mbox folder at any time which will do an imap folder expunge. However, this is not currently possible with imap accounts configured with maildir as described here: bug 1827973.

Note also, I haven't addressed the issue with folder compacting based on the amount of disk space it would free up in the mbox or maildir files, as mentioned in comment 2. I think that's a subject of another bug.

Back to Bug 1855985 Comment 3