Quota namespace questions

Bron Gondwana brong at fastmail.fm
Wed Jan 18 19:12:53 EST 2017


On Thu, 19 Jan 2017, at 10:06, Nic Bernstein via Cyrus-devel wrote:

> Friends,

>  I'm working on documentation for various things Quota related, and
>  find that I'm a little confused about the "quota namespace."  It
>  appears that, due to the second argument in
>  "mboxname_init_namespace(&quota_namespace, 1)" (quota.c:176) that
>  quota operations don't use 'altnamespace':


No admin operations use altnamespace.  Altnamespace is purely over the
wire.  It doesn't make sense for admins, because admins don't have their
own user space.

>>     namespace->isadmin = isadmin;  namespace->hier_sep =
>>     config_getswitch(IMAPOPT_UNIXHIERARCHYSEP) ? '/' : '.'; namespace-
>>     >isalt = !isadmin && config_getswitch(IMAPOPT_ALTNAMESPACE);  namespace-
>>     >accessible[NAMESPACE_INBOX] = 1; namespace-
>>     >accessible[NAMESPACE_USER] =
>>     !config_getswitch(IMAPOPT_DISABLE_USER_NAMESPACE); namespace-
>>     >accessible[NAMESPACE_SHARED] =
>>     !config_getswitch(IMAPOPT_DISABLE_SHARED_NAMESPACE);  if (namespace-
>>     >isalt) { ... }  else { /* standard namespace */ sprintf(namespace-
>>     >prefix[NAMESPACE_INBOX], "%s%c", "INBOX", namespace->hier_sep);
>>     sprintf(namespace->prefix[NAMESPACE_USER], "%s%c", "user", namespace-
>>     >hier_sep); strcpy(namespace->prefix[NAMESPACE_SHARED], ""); }
>>     return 0; }
>>
> Am I reading that right (hint: not a C programmer)?  But it also looks
> to me like it should still use '/' as the hierarchy separator, right?


Yes, it should.  It's a display bug not to show the separator as / in
any tool output.


>  That's not what I'm seeing in my quota_db.  I started with a system
>  with no quotas.  The old configuration used quotalegacy, so when I
>  added some quotas, they ended up in /var/lib/imap/quota...:


On the other hand, the files themselves on disk and disk paths are
internal names always.

>> # cyradm -U cyrus localhost Password: localhost> sq user/nic STORAGE
>> # 20000000 localhost> sq user/tim STORAGE 20000000 localhost> sq
>> # user/crystal STORAGE 20000000 localhost> sq user/nic X-NUM-FOLDERS
>> # 1000 localhost> quit  # head /var/lib/imap/quota/*/* ==>
>> # /var/lib/imap/quota/H/user.crystal <== %(S (1190064060 20000000) M
>> # (13742) AS (3) NF (15))  ==> /var/lib/imap/quota/K/user.tim <== %(S
>> # (401903846 20000000) M (7308) AS (2) NF (8))  ==>
>> # /var/lib/imap/quota/N/user.nic <== %(S (1484883490) M (36930) AS
>> # (18) NF (42 1000))
>>
> I then used cvt_cyrusdb to convert from quotalegacy to twoskip, and I
> still am seeing the netnews separator, rather than unix, both in the
> quota_db and in the output from "quota -f":


The contents of quota_db should definitely be . separated.


>> # strings /tmp/quota.db twoskip file user.crystal%(S (1190064060
>> # 20000000) M (13742) AS (3) NF (15)) user.nic%(S (1484883490
>> # 20000000) M (36930) AS (18) NF (42)) user.tim%(S (401903846
>> # 20000000) M (7308) AS (2) NF (8))$  # su cyrus -c "cyrus quota -f"
>> # Quota   % Used     Used             Resource Root 20000000        5
>> # 1162171              STORAGE user.crystal 13742
>> # MESSAGE user.crystal 0 X-ANNOTATION-STORAGE user.crystal 15
>> # X-NUM-FOLDERS user.crystal 1450081              STORAGE user.nic
>> # 36930              MESSAGE user.nic 0 X-ANNOTATION-STORAGE user.nic
>> # 1000        4       42        X-NUM-FOLDERS user.nic 20000000
>> # 1   392484              STORAGE user.tim 7308              MESSAGE
>> # user.tim 0 X-ANNOTATION-STORAGE user.tim 8        X-NUM-FOLDERS
>> # user.tim
>>
> 

> Now to be clear, I have no problem with this if it works, but I'm
> concerned about confusing administrators.


The output of quota -f is wrong.  That's a bug.



https://github.com/cyrusimap/cyrus-imapd/issues/1800



>  We already have the task of teaching existing Cyrus admins about all
>  of the ramifications of converting to 'altnamespace: on' and
>  'unixhierarchysep: on' as the new defaults.  This brings a new "but
>  not here" context on top of it.
> 

>  Similarly, for new folks, who don't know or care about historical
>  legacies, we need to explain that while they're used to using slash
>  "/" they won't see that from "quota" runs, or when they go poking
>  around to repair quota problems.
> 

>  I think I just need a good dose of cluefullness to proceed. :-)

> 

>  Cheers,

>      -nic

> 

>  PS - perl/imap/IMAP/Shell.pm POD info still says "The only
>     I<resource> understood by B<Cyrus> is C<STORAGE>."  This needs
>     updating (I'm happy to do this.)


Thanks.


Bron.



--

  Bron Gondwana

  brong at fastmail.fm




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/cyrus-devel/attachments/20170119/44f1758e/attachment.html>


More information about the Cyrus-devel mailing list