<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div style="font-family:Arial;">On Thu, 19 Jan 2017, at 10:06, Nic Bernstein via Cyrus-devel wrote:<br></div>
<blockquote type="cite"><div style="font-family:Arial;">Friends,<br></div>
<div style="font-family:Arial;"> 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': <br></div>
</blockquote><div style="font-family:Arial;"><br></div>
<div style="font-family:Arial;">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.<br></div>
<div style="font-family:Arial;"><br></div>
<blockquote type="cite"><blockquote><pre>    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;
}
<br></pre></blockquote><div style="font-family:Arial;">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? <br></div>
</blockquote><div style="font-family:Arial;"><br></div>
<div style="font-family:Arial;">Yes, it should.  It's a display bug not to show the separator as / in any tool output.<br></div>
<div style="font-family:Arial;"><br></div>
<blockquote type="cite"><div style="font-family:Arial;"> 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...: <br></div>
</blockquote><div style="font-family:Arial;"><br></div>
<div style="font-family:Arial;">On the other hand, the files themselves on disk and disk paths are internal names always.<br></div>
<div style="font-family:Arial;"><br></div>
<blockquote type="cite"><blockquote><pre># 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))
<br></pre></blockquote><div style="font-family:Arial;">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": <br></div>
</blockquote><div style="font-family:Arial;"><br></div>
<div style="font-family:Arial;">The contents of quota_db should definitely be . separated.<br></div>
<div style="font-family:Arial;"><br></div>
<blockquote type="cite"><blockquote><pre># 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
<br></pre></blockquote><div style="font-family:Arial;"><br></div>
<div style="font-family:Arial;">Now to be clear, I have no problem with this if it works, but I'm
    concerned about confusing administrators. <br></div>
</blockquote><div style="font-family:Arial;"><br></div>
<div style="font-family:Arial;">The output of quota -f is wrong.  That's a bug.<br></div>
<div style="font-family:Arial;"><br></div>
<div style="font-family:Arial;"><a href="https://github.com/cyrusimap/cyrus-imapd/issues/1800">https://github.com/cyrusimap/cyrus-imapd/issues/1800</a><br></div>
<div style="font-family:Arial;"><br></div>
<blockquote type="cite"><div style="font-family:Arial;"> 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.<br></div>
<div style="font-family:Arial;"> <br></div>
<div style="font-family:Arial;"> 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.<br></div>
<div style="font-family:Arial;"> <br></div>
<div style="font-family:Arial;"> I think I just need a good dose of cluefullness to proceed. :-)<br></div>
<div style="font-family:Arial;"> <br></div>
<div style="font-family:Arial;"> Cheers,<br></div>
<div style="font-family:Arial;">     -nic<br></div>
<div style="font-family:Arial;"> <br></div>
<div style="font-family:Arial;"> 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.) <br></div>
</blockquote><div style="font-family:Arial;"><br></div>
<div style="font-family:Arial;">Thanks.<br></div>
<div style="font-family:Arial;"><br>Bron.<br></div>
<div style="font-family:Arial;"><br></div>
<div id="sig567075"><div class="signature">--<br></div>
<div class="signature">  Bron Gondwana<br></div>
<div class="signature">  brong@fastmail.fm<br></div>
<div class="signature"><br></div>
</div>
<div style="font-family:Arial;"><br></div>
</body>
</html>