<!DOCTYPE html><html><head><title></title><style type="text/css">#qt #qt-qt{font-family:Helvetica, Arial, sans-serif;font-size:12px;color:rgb(51, 51, 51);}
p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div style="font-family:Arial;"><br></div><div style="font-family:Arial;"><br></div><div>On Fri, Jul 19, 2019, at 10:09, Bron Gondwana wrote:<br></div><blockquote type="cite" id="qt"><div style="font-family:Arial;">On Thu, Jul 18, 2019, at 19:09, Egoitz Aurrekoetxea wrote:<br></div><blockquote id="qt-qt" type="cite"><div style="font-family:Arial;">Good morning,<br></div><div class="qt-qt-"><br></div><div class="qt-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-qt-"><br></div><div class="qt-qt-">In mboxlist_delayed_deletemailbox() : <br></div><div class="qt-qt-"><br></div><div class="qt-qt-"><div class="qt-qt-"><b class="qt-qt-">If (!preserve_delete_delayed_folders_always)</b><br></div><div class="qt-qt-"><b class="qt-qt-">{</b><br></div><div class="qt-qt-"> /* keep the last 19, so the new one is the 20th */<br></div><div class="qt-qt-"> for (i = 0; i < (int)existing.count - 19; i++) {<br></div><div class="qt-qt-"> const char *subname = strarray_nth(&existing, i);<br></div><div class="qt-qt-"> syslog(LOG_NOTICE, "too many subfolders for %s, deleting %s (%d / %d)",<br></div><div class="qt-qt-"> newname, subname, i+1, (int)existing.count);<br></div><div class="qt-qt-"> r = mboxlist_deletemailbox(subname, 1, userid, auth_state, NULL, 0, 1, 1,<br></div><div class="qt-qt-"> keep_intermediaries);<br></div><div class="qt-qt-"> if (r) goto done;<br></div><div class="qt-qt-"> }<br></div><div class="qt-qt-"><b class="qt-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></blockquote><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">I've pushed commits to master and 3.0 to remove this check.<br></div><div style="font-family:Arial;"><br></div><div id="sig56629417"><div class="signature">--<br></div><div class="signature"> Bron Gondwana, CEO, Fastmail Pty Ltd<br></div><div class="signature"> brong@fastmailteam.com<br></div><div class="signature"><br></div></div><div style="font-family:Arial;"><br></div></body></html>