6.0.0-git
2019-05-19

[#3716] Can't delete emails (to trash) when quota is full
Summary Can't delete emails (to trash) when quota is full
Queue IMP
Queue Version 4.1
Type Bug
State Resolved
Priority 1. Low
Owners
Requester tuomas.silen (at) nodeta (dot) fi
Created 2006-03-30 (4798 days ago)
Due
Updated 2006-03-30 (4798 days ago)
Assigned
Resolved 2006-03-30 (4798 days ago)
Milestone
Patch No

History
2006-03-30 21:15:23 Michael Slusarz State ⇒ Resolved
 
2006-03-30 17:57:00 Chuck Hagenbuch Comment #4 Reply to this comment
Michael, should this be marked as resolved or duplicate now?
2006-03-30 15:35:31 Michael Slusarz Comment #3 Reply to this comment

[Show Quoted Text - 12 lines]
Fixed in HEAD and 4.1.1.
2006-03-30 15:35:01 Michael Slusarz Deleted Original Message
 
2006-03-30 15:30:32 Michael Slusarz Comment #2 Reply to this comment

[Show Quoted Text - 9 lines]
Duplicate of Bug 3687.


2006-03-30 12:01:17 tuomas (dot) silen (at) nodeta (dot) fi Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Summary ⇒ Can't delete emails (to trash) when quota is full
Queue ⇒ IMP
New Attachment: Message.patch
Reply to this comment
There seems to be some bugs in delete() function in lib/Message.php that

prevent emails from being deleted (or actually being moved to trash) when

quota is full.



First, on line 205 there is line

     if (stristr('over quota', $error_msg) !== false) {

The definition of this function is stristr ( string haystack, string needle )

So the parameters are mixed up and it probably never matches with anything.



Also at least with Courier IMAP, you get an error "You exceeded your 
mail quota" so it certainly won't match.



Changing the line to

    if ((stristr($error_msg, 'over quota') !== false) || 
(stristr($error_msg, 'exceeded your mail quota') !== false)) {

works for me.



Now the file gets deleted, but not moved to the trash and you still 
get the quota exeeced error. This is because of an other bug on line 
218:

    if (!@imap_append($imp['stream'], $trash, $val)) {

This actually returns an error that INBOX.Trash does not exist, but $error_msg

is not updated.



Apparently $trash should be IMP::serverString($trash).



Attached patch seems to fix these problems.


Saved Queries