#1486299 closed Bugs (fixed)
delete_always not working as expected on over quota account
| Reported by: | iezzip | Owned by: | |
|---|---|---|---|
| Priority: | 3 | Milestone: | 0.4-beta |
| Component: | Core functionality | Version: | 0.3.1 |
| Severity: | trivial | Keywords: | |
| Cc: |
Description
The {{delete_always}} setting is a great thing. It acts as a fallback if the account is over quota and instead of moving the message to "Trash" (which would not be possible due to IMAP's strict quota) it marks it as deleted...
/** * 'Delete always' * This setting reflects if mail should be always marked as deleted, * even if moving to "Trash" fails. This is necessary in some setups * because a) people may not have a Trash folder or b) they are over * quota (and Trash is included in the quota). * * This is a failover setting for iil_C_Move when a message is moved * to the Trash. */ $rcmail_config['delete_always'] = true;
I encountered the following problem on a over quota account (> 100%): If I delete a message (by the delete icon or by keyboard), it is gone / no longer visible in the message list. Actually it should have been grayed-out (marked as deleted) and still show up in the message list. But with current stable 0.3.1 the message does not get deleted, it shows up again as soon as I click on another folder and get back to the INBOX again.
The user thinks, the message is gone and he never get the idea to click on the bottom-left "Folder: Compact" icon.
If he would click on "Compact" right after deleting the message, it would be gone for good. But the message never gets marked as deleted.
Can anyone reproduce this?
- Roundcube 0.3.1
- $rcmail_config['delete_always'] = true;
- server settings -> main options:
[x] Mark the message as read on delete [ ] Flag the message for deletion instead of delete [ ] Do not show deleted messages
Attachments (1)
Change History (12)
comment:1 Changed 4 years ago by bartd
comment:2 follow-up: ↓ 4 Changed 4 years ago by bartd
i guessed right, this fixed it for me:
--- rcube_imap.php.old 2009-11-16 15:18:42.000000000 +0100
+++ rcube_imap.php 2009-11-16 15:18:54.000000000 +0100
@@ -1746,3 +1746,6 @@
else if (rcmail::get_instance()->config->get('delete_always', false)) {
- return iil_C_Delete($this->conn, $from_mbox, join(',', $a_uids));
+ $delete = iil_C_Delete($this->conn, $from_mbox, join(',', $a_uids));
+ $this->_expunge($from_mbox, FALSE, $a_uids);
+ $this->_clear_messagecount($from_mbox);
+ return $delete;
}
comment:3 follow-up: ↓ 5 Changed 4 years ago by iezzip
thanks!
I tried it like this (setting DELETED flag):
// moving failed
else if (rcmail::get_instance()->config->get('delete_always', false)) {
< return iil_C_Delete($this->conn, $from_mbox, join(',', $a_uids));
> $this->set_flag($a_uids, 'DELETED', $from_mbox);
}
but then, the {{{errormoving}} message ('Could not move the message') did just pop up for less than e second.
Will check your solution right away...
comment:4 in reply to: ↑ 2 ; follow-up: ↓ 6 Changed 4 years ago by iezzip
Replying to bartd:
i guessed right, this fixed it for me:
--- rcube_imap.php.old 2009-11-16 15:18:42.000000000 +0100 +++ rcube_imap.php 2009-11-16 15:18:54.000000000 +0100 @@ -1746,3 +1746,6 @@ else if (rcmail::get_instance()->config->get('delete_always', false)) { - return iil_C_Delete($this->conn, $from_mbox, join(',', $a_uids)); + $delete = iil_C_Delete($this->conn, $from_mbox, join(',', $a_uids)); + $this->_expunge($from_mbox, FALSE, $a_uids); + $this->_clear_messagecount($from_mbox); + return $delete; }
This deletes the message permanently. That's not what I expect from the delete_always setting. The message should just get marked as deleted (grey).
comment:5 in reply to: ↑ 3 Changed 4 years ago by bartd
Replying to iezzip:
< return iil_C_Delete($this->conn, $from_mbox, join(',', $a_uids));
$this->set_flag($a_uids, 'DELETED', $from_mbox);
as you're only setting the flag after the return function, that won't work properly try this (untested):
$delete = iil_C_Delete($this->conn, $from_mbox, join(',', $a_uids));
$this->set_flag($a_uids, 'DELETED', $from_mbox);
return $delete;
comment:6 in reply to: ↑ 4 Changed 4 years ago by bartd
Replying to iezzip:
This deletes the message permanently. That's not what I expect from the delete_always setting. The message should just get marked as deleted (grey).
Yes it does, I assumed this is what you wanted as it solves the user's inability to fix the quota problem :/ In my case deleted messages are immediately moved to trash, which eliminates the need for expunging (=compacting).
comment:7 Changed 4 years ago by iezzip
Right, your solution fixes the quota problem quite good. And we wouldn't need to answer that many support requests of our dummy customers. But just deleting the messages for good if the mailbox is full seems to be a bit too radical.
Also, I'm trying to get a working solution for the delete_always feature which states:
This setting reflects if mail should be always marked as deleted, even if moving to "Trash" fails.
I am attaching my patch and I'm going to open another ticket for the "errormoving message pops away too fast" problem that has nothing to do with this bug.
Changed 4 years ago by iezzip
comment:8 Changed 4 years ago by iezzip
- Priority changed from 4 to 3
- Severity changed from normal to major
I have raised the severity of this bug to "major" as this also affects regular message moves to other mailboxes. The messages get lost completely, if the user clicks on "Compact" after a failed move.
That's definitely not the intention of delete_always
comment:9 Changed 3 years ago by alec
- Component changed from User Interface to Core functionality
- Resolution set to fixed
- Status changed from new to closed
Fixed behaviour and description of 'delete_always' in [f1ce5163], according to its initial purpose.
comment:10 Changed 3 years ago by ekrieger
- Severity changed from major to trivial
Am i reading the patch right? You save 'trash_mbox' from config into "tbox" and send the delete-command for "fbox" ??? I don't know the code, just looked at the diff, but this seems to me wrong. maybe simple i am wrong ;-)
comment:11 Changed 3 years ago by ekrieger
A i see, i read the code wrong, sorry ;-)

I can reproduce this when delete_always is enabled. I'm guessing that automatically sending an EXPUNGE after the deleting the message should fix it. right here:
http://trac.roundcube.net/browser/trunk/roundcubemail/program/include/rcube_imap.php#L1747