<!DOCTYPE html><html><head><title></title><style type="text/css">#qt {font-family:Helvetica, Arial, sans-serif;font-size:12px;color:rgb(51, 51, 51);}
#qt .qt-firmasarenet{font-family:Helvetica, Arial, sans-serif;text-align:left;color:rgb(51, 51, 51);}
#qt .qt-textosarenet,#qt .qt-titulosarenet{font-family:Helvetica, Arial, sans-serif;font-weight:bold;font-size:12px;color:rgb(51, 51, 51);}
#qt .qt-imgsarenet{margin-top:0px;margin-right:0px;margin-bottom:10px;margin-left:0px;}
#qt .qt-lnksarenet{color:rgb(0, 122, 196) !important;font-size:12px;line-height:1.2;text-decoration-line:underline;text-decoration-style:solid;text-decoration-color:currentcolor;}
#qt .qt-firmasarenet a{color:rgb(0, 122, 196) !important;}
#qt .qt-imprimirsarenet{font-family:Helvetica, Arial, sans-serif;font-weight:normal;font-size:10px;line-height:1.2;color:rgb(0, 102, 0);}
p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div style="font-family:Arial;">On Thu, Jul 18, 2019, at 19:09, Egoitz Aurrekoetxea wrote:<br></div><blockquote type="cite" id="qt"><div style="font-family:Arial;">Good morning,<br></div><div class="qt-"><br></div><div class="qt-">When using delete_delayed if someone removes a big folder (that one with more than 20 subfolders anywhere below it) in mboxlist_delayed_deletemailbox() only last 20 are preserved. We think it could be a good idea to preserve all and to have a parameter for configuring it. The reason for that, is that we use delete_delayed for storing the removed content remotely with the customer hired retention period in slow disk space. Perhaps could be a good idea something like : <br></div><div class="qt-"><br></div><div class="qt-">In mboxlist_delayed_deletemailbox() : <br></div><div class="qt-"><br></div><div class="qt-"><div class="qt-"><b class="qt-">If (!preserve_delete_delayed_folders_always)</b><br></div><div class="qt-"><b class="qt-">{</b><br></div><div class="qt-"> /* keep the last 19, so the new one is the 20th */<br></div><div class="qt-"> for (i = 0; i < (int)existing.count - 19; i++) {<br></div><div class="qt-"> const char *subname = strarray_nth(&existing, i);<br></div><div class="qt-"> syslog(LOG_NOTICE, "too many subfolders for %s, deleting %s (%d / %d)",<br></div><div class="qt-"> newname, subname, i+1, (int)existing.count);<br></div><div class="qt-"> r = mboxlist_deletemailbox(subname, 1, userid, auth_state, NULL, 0, 1, 1,<br></div><div class="qt-"> keep_intermediaries);<br></div><div class="qt-"> if (r) goto done;<br></div><div class="qt-"> }<br></div><div class="qt-"><b class="qt-">}</b><br></div></div></blockquote><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">Hmm.... yeah, OK. This is actually buggy in that case! The intended behaviour was to avoid a Denial of Service attack where you would create and delete the same mailbox name millions of times - however, the whole concept is bogus because there's nothing stopping somebody creating and deleting folder000001 through folderFFFFFF and creating the same attack.<br></div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">I suggest that we just remove this whole silly check entirely, and if we want a similar level of attack protection we do something smarter like a quota for total folders+deleted folders that haven't been cleaned up yet - set it high enough that anybody hitting that is clearly doing something wrong, and require the administrator semi-manually clean up the deleted folders in order to re-allow folder creation.<br></div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">Cheers,<br></div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">Bron.<br></div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">-- <br></div><div id="sig56629417"><div class="signature"> brong@fastmailteam.com<br></div><div class="signature"><br></div></div><div style="font-family:Arial;"><br></div></body></html>