<div dir="ltr"><div dir="ltr"><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 20, 2019 at 2:13 PM Mark Moseley <<a href="mailto:moseleymark@gmail.com">moseleymark@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div class="gmail-m_5214552142079555927gmail-gs" style="margin:0px;padding:0px 0px 20px;width:1270px;font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif"><div class="gmail-m_5214552142079555927gmail-"><div id="gmail-m_5214552142079555927gmail-:gj1" class="gmail-m_5214552142079555927gmail-ii gmail-m_5214552142079555927gmail-gt" style="font-size:12.800000190734863px;margin:8px 0px 0px;padding:0px"><div id="gmail-m_5214552142079555927gmail-:gi4" class="gmail-m_5214552142079555927gmail-a3s gmail-m_5214552142079555927gmail-aXjCH"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_quote"><div class="gmail-m_5214552142079555927gmail-adM"><div class="gmail-m_5214552142079555927gmail-im"><div class="gmail_attr">Just hoping to get some dev eyes on this. I'm incredibly reluctant to throw the word 'bug' around</div><div class="gmail_attr">(since 99 times out of 100, it's not -- it's almost always the config), but I can't think of any way </div><div class="gmail_attr">that this could be a config issue, esp when the pre-2.2.34 version works as expected.</div><div class="gmail_attr"><br></div><div class="gmail_attr">I noticed during troubleshooting that dovecot errors out if I try to create a subfolder called</div><div class="gmail_attr">'INBOX' but it'll happily create a subfolder called INBOX.SomethingElse (i.e. a folder called </div><div class="gmail_attr">INBOX.INBOX.SomethingElse - resulting in a directory called .INBOX.SomethingElse on the </div><div class="gmail_attr">filesystem, and leading to the problem described below). Is that sub-subfolder creation (where</div><div class="gmail_attr">the top level subfolder matches the namespace name) supposed to be allowed? It seems</div><div class="gmail_attr">odd that 'INBOX' (as a subfolder of INBOX) would be blocked but INBOX.SomethingElse (as</div><div class="gmail_attr">a subfolder of INBOX) would be allowed. I'd expect INBOX.SomethingElse (i.e. </div><div class="gmail_attr">INBOX.INBOX.SomethingElse) would be blocked as well.</div><div class="gmail_attr"><br></div><div dir="ltr" class="gmail_attr"><br></div><div dir="ltr" class="gmail_attr">On Wed, Mar 13, 2019 at 4:46 AM Bernd Wurst via dovecot <<a href="mailto:dovecot@dovecot.org" target="_blank">dovecot@dovecot.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hello,<br><br>we're operating dovecot on a small server. Some years ago, we migrated<br>from courier IMAP to dovecot. Therefore, we defined our default<br>Namespace "inbox" with prefix "INBOX." to have this compatible. I found<br>this in some migration docs those days. Generally, everything worked as<br>expected.<br><br>Our only namespace is configured like this:<br><br>namespace inbox {<br> separator = .<br>  prefix = INBOX.<br>  inbox = yes<br>}<br><br>Regularly, there is no folder named INBOX or .INBOX in the file system,<br>I suppose this is correct.  But I found a special corner case today when<br>it comes to quota calculation.<br><br>When - for whatever reason - a folder .INBOX.foo (for arbitrary values<br>of foo) exists, the whole mailbox is counted twice in quota<br>recalculation. Just creating .INBOX does nothing but a subfolder<br>triggers the problem.<br><br>This is my shell view (replaced username and file path and deleted<br>unnecessary debug output)<br><br>$ cat maildirsize<br>268435456S<br>14697 17<br>$ maildirmake .INBOX.foo<br>$ sudo doveadm -D quota recalc -u <user><br>[...]<br>doveadm(<user>): Debug: Namespace inbox: type=private, prefix=INBOX.,<br>sep=., inbox=yes, hidden=no, list=yes, subscriptions=yes<br>location=maildir:/home/.../test<br>doveadm(<user>): Debug: maildir++: root=/home/.../test, index=,<br>indexpvt=, control=, inbox=/home/.../test, alt=<br>doveadm(<user>): Debug: Namespace : type=private, prefix=, sep=,<br>inbox=no, hidden=yes, list=no, subscriptions=no location=fail::LAYOUT=none<br>doveadm(<user>): Debug: none: root=, index=, indexpvt=, control=,<br>inbox=, alt=<br>doveadm(<user>): Debug: quota: quota_over_flag check: quota_over_script<br>unset - skipping<br>doveadm(<user>): Debug: Quota root User quota: Recalculated relative<br>rules with bytes=268435456 count=0. Now grace=26843545<br>doveadm(<user>): Debug: Namespace INBOX.: Using permissions from<br>/home/.../test: mode=0700 gid=default<br><br>$ cat maildirsize<br>268435456S<br>29394 34<br><br><br>So the used quota has exactly been doubled by just creating an empty<br>subfolder.<br><br>Do you have any pointers for fixing my configuration or is this a bug in<br>dovecot?<br><br></blockquote><div><br></div></div></div><div>I coincidentally resurrected a months-old thread with this same issue a few days ago. I'm seeing the exact same after upgrading from 2.2.32 to 2.2.36.</div><div><br></div><div>The original poster (who also narrowed it down to something in 2.2.34) mentioned a workaround that does indeed work, namely setting mailbox_list_index=no:</div><div><br></div><div>> doveadm -o 'mailbox_list_index=no' quota recalc -u myuser<br></div><div><br></div><div>I've been staring at diffs of 2.2.33 and 2.2.34 without anything jumping out at me (not a C guy, sadly). Maybe src/lib-storage/index/index-storage.c or src/lib-storage/list/mailbox-list-fs-iter.c or src/lib-storage/list/mailbox-list-index-iter.c or src/lib-storage/list/mailbox-list-index.c?</div><div><br></div><div>The latter few have some added strcmp's against "INBOX". Then again, there's a lot of new code in the diffs under src/lib-storage that references INBOX specifically.</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></blockquote><div><br></div><div>Can the Dovecot team confirm whether this is indeed a bug or not?  I've not yet been able to test 2.3.x to see if the problem exists there as well.<br></div></div></div>