<!--/*SC*/DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"/*EC*/-->
<html><head><title></title><style type="text/css"><!-- body{padding:1ex;margin:0;font-family:sans-serif;font-size:small}a[href]{color:-moz-hyperlinktext!important;text-decoration:-moz-anchor-decoration}blockquote{margin:0;border-left:2px solid #144fae;padding-left:1em}blockquote blockquote{border-color:#006312}blockquote blockquote blockquote{border-color:#540000} --></style></head><body><div style="font-family: Arial; font-size: medium;" dir="ltr"><div class="defangedMessage">
        <div id="me73396">
                <div>
                        Sorry I haven&#39;t commented.&nbsp; Yes, I think you&#39;re right - it&#39;s a bug.&nbsp; I tried to fix something like it a while back and created more and worse bugs, so I reverted the change.</div>
                <div>
                        &nbsp;</div>
                <div>
                        The way that usernames and folder details are handled in sieve is a right mess... conversions backwards and forwards between internal and external namespaces.</div>
                <div>
                        &nbsp;</div>
                <div>
                        It&#39;s on the &quot;to look at before 2.5&quot; list.&nbsp; I&#39;m travelling at the moment, so I&#39;m not spending as much time on Cyrus as I&#39;d like :(&nbsp; I&#39;d love anyone else who has time to take a look too... see if they can untangle the conversions!</div>
                <div>
                        &nbsp;</div>
                <div>
                        Bron.</div>
                <div>
                        &nbsp;</div>
                <div>
                        On Sun, Nov 25, 2012, at 11:31 AM, Thomas Cataldo wrote:</div>
                <blockquote class="me73396QuoteMessage" type="cite">
                        Can anyone comment on that ?
                        <div>
                                &nbsp;</div>
                        <div>
                                We might be doing something wrong while settings our ACLs, but looking with wireshark at how cyradm I think we&#39;re fine and that there&#39;s really a bug in here.</div>
                        <div>
                                &nbsp;</div>
                        <div>
                                Thomas,</div>
                        <div>
                                Blue Mind.</div>
                        <div>
                                &nbsp;</div>
                        <div class="me73396gmail_extra">
                                <br />
                                <br />
                                <div class="me73396gmail_quote">
                                        On Mon, Nov 19, 2012 at 8:39 PM, Thomas Cataldo <span dir="ltr">&lt;<a href="mailto:tcataldo@gmail.com" target="_blank">tcataldo@gmail.com</a>&gt;</span> wrote:<br />
                                        <blockquote class="me73396gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                                                Hi,
                                                <div>
                                                        &nbsp;</div>
                                                <div>
                                                        I did some more research on my problem and tracked the problem down to this test in append.c (cyrus 2.4) :</div>
                                                <div>
                                                        &nbsp;</div>
                                                <div>
                                                        <div>
                                                                &nbsp; &nbsp; &nbsp; &nbsp; else if (!strcmp(flag[i], &quot;\\flagged&quot;)) {</div>
                                                        <div>
                                                                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (as-&gt;myrights &amp; ACL_WRITE) { &nbsp;// this test fails when mailbox is a.b@domain</div>
                                                        <div>
                                                                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; message_index.system_flags |= FLAG_FLAGGED;</div>
                                                        <div>
                                                                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div>
                                                        <div>
                                                                &nbsp; &nbsp; &nbsp; &nbsp; }</div>
                                                </div>
                                                <div>
                                                        &nbsp;</div>
                                                <div>
                                                        My problem is probably related to unixhierarchysep settings and the way ACLs are set, but the following patch fixes it :</div>
                                                <div>
                                                        &nbsp;</div>
                                                <div>
                                                        <div>
                                                                diff --git a/imap/append.c b/imap/append.c</div>
                                                        <div>
                                                                index d3c2bd4..b622dd1 100644</div>
                                                        <div>
                                                                --- a/imap/append.c</div>
                                                        <div>
                                                                +++ b/imap/append.c</div>
                                                        <div>
                                                                @@ -160,12 +160,25 @@ int append_setup(struct appendstate *as, const char *name,</div>
                                                        <div>
                                                                &nbsp;{</div>
                                                        <div>
                                                                &nbsp; &nbsp; &nbsp;int r;</div>
                                                        <div>
                                                                &nbsp; &nbsp; &nbsp;struct quota q;</div>
                                                        <div>
                                                                + &nbsp; &nbsp;unsigned int pos;</div>
                                                        <div>
                                                                + &nbsp; &nbsp;size_t at_char;</div>
                                                        <div>
                                                                + &nbsp; &nbsp;char* fixed_acls;</div>
                                                        <div>
                                                                &nbsp;</div>
                                                        <div>
                                                                &nbsp; &nbsp; &nbsp;as-&gt;mailbox = NULL;</div>
                                                        <div>
                                                                &nbsp; &nbsp; &nbsp;r = mailbox_open_iwl(name, &amp;as-&gt;mailbox);</div>
                                                        <div>
                                                                &nbsp; &nbsp; &nbsp;if (r) return r;</div>
                                                        <div>
                                                                &nbsp;</div>
                                                        <div>
                                                                - &nbsp; &nbsp;as-&gt;myrights = cyrus_acl_myrights(auth_state, as-&gt;mailbox-&gt;acl);</div>
                                                        <div>
                                                                + &nbsp; &nbsp;fixed_acls = strdup(as-&gt;mailbox-&gt;acl);</div>
                                                        <div>
                                                                + &nbsp; &nbsp;syslog(LOG_ERR, &quot;before acls tweaks: %s\n&quot;, fixed_acls);</div>
                                                        <div>
                                                                + &nbsp; &nbsp;at_char = strcspn(fixed_acls, &quot;@&quot;);</div>
                                                        <div>
                                                                + &nbsp; &nbsp;for (pos=0; pos &lt; at_char; pos++) {</div>
                                                        <div>
                                                                + &nbsp; &nbsp; &nbsp;if (fixed_acls[pos] == &#39;.&#39;) {</div>
                                                        <div>
                                                                + &nbsp; &nbsp; &nbsp; fixed_acls[pos] = &#39;^&#39;;</div>
                                                        <div>
                                                                + &nbsp; &nbsp; &nbsp;}</div>
                                                        <div>
                                                                + &nbsp; &nbsp;}</div>
                                                        <div>
                                                                + &nbsp; &nbsp;syslog(LOG_ERR, &quot;after acls tweaks: %s\n&quot;, fixed_acls);</div>
                                                        <div>
                                                                +</div>
                                                        <div>
                                                                + &nbsp; &nbsp;as-&gt;myrights = cyrus_acl_myrights(auth_state, fixed_acls);</div>
                                                        <div>
                                                                &nbsp;</div>
                                                        <div>
                                                                &nbsp; &nbsp; &nbsp;if ((as-&gt;myrights &amp; aclcheck) != aclcheck) {</div>
                                                        <div>
                                                                &nbsp; &nbsp; &nbsp; &nbsp; r = (as-&gt;myrights &amp; ACL_LOOKUP) ?</div>
                                                </div>
                                                <div>
                                                        &nbsp;</div>
                                                <div>
                                                        &nbsp;</div>
                                                <div>
                                                        The two logs I added give the following output :</div>
                                                <div>
                                                        &nbsp;</div>
                                                <div>
                                                        <div>
                                                                Nov 19 20:37:00 ppday cyrus/lmtp[42207]: before acls tweaks: a.b@buffy.vmw#011lrswipkxtecda#011admin0#011lrswipkxtecda#011admin@buffy.vmw#011lrsp#011</div>
                                                        <div>
                                                                Nov 19 20:37:00 ppday cyrus/lmtp[42207]: after acls tweaks: a^b@buffy.vmw#011lrswipkxtecda#011admin0#011lrswipkxtecda#011admin@buffy.vmw#011lrsp#011</div>
                                                </div>
                                                <div>
                                                        &nbsp;</div>
                                                <div>
                                                        I hope this &quot;test&quot; patch might help figure out what is wrong. My acls setup or a bug.</div>
                                                <div>
                                                        &nbsp;</div>
                                                <div>
                                                        Regards,</div>
                                                <div>
                                                        Thomas Cataldo,</div>
                                                <div>
                                                        Blue Mind.</div>
                                                <div class="me73396HOEnZb">
                                                        <div class="me73396h5">
                                                                <div>
                                                                        &nbsp;</div>
                                                                <div>
                                                                        &nbsp;</div>
                                                                <div>
                                                                        &nbsp;</div>
                                                                <div>
                                                                        &nbsp;</div>
                                                                <div>
                                                                        &nbsp;</div>
                                                                <div class="me73396gmail_extra">
                                                                        <br />
                                                                        <br />
                                                                        <div class="me73396gmail_quote">
                                                                                On Wed, Nov 14, 2012 at 10:40 AM, Thomas Cataldo <span dir="ltr">&lt;<a href="mailto:tcataldo@gmail.com" target="_blank">tcataldo@gmail.com</a>&gt;</span> wrote:<br />
                                                                                <blockquote class="me73396gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                                                                                        Hello,
                                                                                        <div>
                                                                                                &nbsp;</div>
                                                                                        <div>
                                                                                                Consider the following sieve setup :</div>
                                                                                        <div>
                                                                                                &nbsp;</div>
                                                                                        <div>
                                                                                                <div>
                                                                                                        root@ppday:/var/spool/sieve# cat global/buffy.vmw.sieve.script&nbsp;</div>
                                                                                                <div>
                                                                                                        require [&quot;body&quot;, &quot;copy&quot;, &quot;fileinto&quot;, &quot;imapflags&quot; ];</div>
                                                                                                <div>
                                                                                                        &nbsp;</div>
                                                                                                <div>
                                                                                                        # filters</div>
                                                                                                <div>
                                                                                                        if allof ( address :contains &quot;from&quot; &quot;admin&quot;) {</div>
                                                                                                <div>
                                                                                                        setflag &quot;\\Flagged&quot;;</div>
                                                                                                <div>
                                                                                                        }</div>
                                                                                                <div>
                                                                                                        &nbsp;</div>
                                                                                                <div>
                                                                                                        # END</div>
                                                                                                <div>
                                                                                                        &nbsp;</div>
                                                                                                <div>
                                                                                                        root@ppday:/var/spool/sieve# cat domain/b/buffy.vmw/a/a^b/bm-user5.sieve.script&nbsp;</div>
                                                                                                <div>
                                                                                                        require [&quot;body&quot;, &quot;copy&quot;, &quot;fileinto&quot;, &quot;imapflags&quot;, &quot;vacation&quot;, &quot;include&quot; ];</div>
                                                                                                <div>
                                                                                                        &nbsp;</div>
                                                                                                <div>
                                                                                                        include :global &quot;buffy.vmw.sieve&quot;;</div>
                                                                                                <div>
                                                                                                        &nbsp;</div>
                                                                                                <div>
                                                                                                        # END</div>
                                                                                                <div>
                                                                                                        &nbsp;</div>
                                                                                                <div>
                                                                                                        &nbsp;</div>
                                                                                                <div>
                                                                                                        root@ppday:/var/spool/sieve# cat domain/b/buffy.vmw/s/sp/bm-user6.sieve.script&nbsp;</div>
                                                                                                <div>
                                                                                                        require [&quot;body&quot;, &quot;copy&quot;, &quot;fileinto&quot;, &quot;imapflags&quot;, &quot;vacation&quot;, &quot;include&quot; ];</div>
                                                                                                <div>
                                                                                                        &nbsp;</div>
                                                                                                <div>
                                                                                                        include :global &quot;buffy.vmw.sieve&quot;;</div>
                                                                                                <div>
                                                                                                        &nbsp;</div>
                                                                                                <div>
                                                                                                        &nbsp;</div>
                                                                                                <div>
                                                                                                        # END</div>
                                                                                        </div>
                                                                                        <div>
                                                                                                &nbsp;</div>
                                                                                        <div>
                                                                                                When admin@buffy.vmw sends an email to a.b@buffy.vmw and sp@buffy.vmw, the following happens :</div>
                                                                                        <div>
                                                                                                &nbsp;- the mail is correctly flagged for sp</div>
                                                                                        <div>
                                                                                                &nbsp;- no flagging for a.b</div>
                                                                                        <div>
                                                                                                &nbsp;</div>
                                                                                        <div>
                                                                                                Nothing interesting in my logs when the mail is delivered :</div>
                                                                                        <div>
                                                                                                &nbsp;</div>
                                                                                        <div>
                                                                                                &nbsp;</div>
                                                                                        <div>
                                                                                                <div>
                                                                                                        Nov 14 10:17:20 ppday cyrus/master[19560]: about to exec /usr/lib/cyrus/bin/lmtpd</div>
                                                                                                <div>
                                                                                                        Nov 14 10:17:20 ppday cyrus/lmtp[19560]: executed</div>
                                                                                                <div>
                                                                                                        Nov 14 10:17:20 ppday cyrus/lmtp[19560]: skiplist: checkpointed /var/lib/cyrus/statuscache.db (0 records, 144 bytes) in 0 seconds</div>
                                                                                                <div>
                                                                                                        Nov 14 10:17:21 ppday cyrus/lmtp[19560]: accepted connection</div>
                                                                                                <div>
                                                                                                        Nov 14 10:17:21 ppday cyrus/lmtp[19560]: connection from ppday.buffy.vmw [172.16.78.128] preauth&#39;d as postman</div>
                                                                                                <div>
                                                                                                        Nov 14 10:17:21 ppday cyrus/lmtp[19560]: Delivered: &lt;1c42d02ef8953cb9521bbbb9dafbaa21@buffy.vmw&gt; to mailbox: buffy.vmw!user.a^b</div>
                                                                                                <div>
                                                                                                        Nov 14 10:17:21 ppday cyrus/lmtp[19560]: USAGE a^b user: 0.004000 sys: 0.008000</div>
                                                                                                <div>
                                                                                                        Nov 14 10:17:21 ppday cyrus/lmtp[19560]: Delivered: &lt;1c42d02ef8953cb9521bbbb9dafbaa21@buffy.vmw&gt; to mailbox: buffy.vmw!user.admin</div>
                                                                                                <div>
                                                                                                        Nov 14 10:17:21 ppday cyrus/lmtp[19560]: USAGE admin user: 0.000000 sys: 0.004000</div>
                                                                                                <div>
                                                                                                        Nov 14 10:17:21 ppday cyrus/lmtp[19560]: Delivered: &lt;1c42d02ef8953cb9521bbbb9dafbaa21@buffy.vmw&gt; to mailbox: buffy.vmw!user.sp</div>
                                                                                                <div>
                                                                                                        Nov 14 10:17:21 ppday cyrus/lmtp[19560]: USAGE sp user: 0.000000 sys: 0.000000</div>
                                                                                                <div>
                                                                                                        Nov 14 10:17:21 ppday postfix/lmtp[19551]: 5DA0A21E37: to=&lt;a.b@buffy.vmw&gt;, relay=172.16.78.128[172.16.78.128]:2400, delay=0.93, delays=0.07/0.03/0.03/0.79, dsn=2.1.5, status=sent (250 2.1.5 Delivery OK)</div>
                                                                                                <div>
                                                                                                        Nov 14 10:17:21 ppday postfix/lmtp[19551]: 5DA0A21E37: to=&lt;admin@buffy.vmw&gt;, relay=172.16.78.128[172.16.78.128]:2400, delay=0.93, delays=0.07/0.03/0.03/0.79, dsn=2.1.5, status=sent (250 2.1.5 Delivery OK)</div>
                                                                                                <div>
                                                                                                        Nov 14 10:17:21 ppday postfix/lmtp[19551]: 5DA0A21E37: to=&lt;sp@buffy.vmw&gt;, relay=172.16.78.128[172.16.78.128]:2400, delay=0.93, delays=0.07/0.03/0.03/0.79, dsn=2.1.5, status=sent (250 2.1.5 Delivery OK)</div>
                                                                                                <div>
                                                                                                        Nov 14 10:17:21 ppday postfix/qmgr[20160]: 5DA0A21E37: removed</div>
                                                                                        </div>
                                                                                        <div>
                                                                                                &nbsp;</div>
                                                                                        <div>
                                                                                                Any know bugs with global sieve vs mailboxes with &quot;dot&quot; in them ?</div>
                                                                                        <div>
                                                                                                Can I enable more verbose sieve execution logs ?</div>
                                                                                        <div>
                                                                                                &nbsp;</div>
                                                                                        <div>
                                                                                                &nbsp;</div>
                                                                                        <div>
                                                                                                Regards,</div>
                                                                                        <div>
                                                                                                Thomas Cataldo,</div>
                                                                                        <div>
                                                                                                Blue Mind</div>
                                                                                        <div>
                                                                                                &nbsp;</div>
                                                                                </blockquote>
                                                                        </div>
                                                                </div>
                                                        </div>
                                                </div>
                                        </blockquote>
                                </div>
                        </div>
                        <div>
                                ----</div>
                        <div>
                                Cyrus Home Page: <a href="http://www.cyrusimap.org/">http://www.cyrusimap.org/</a></div>
                        <div>
                                List Archives/Info: <a href="http://lists.andrew.cmu.edu/pipermail/info-cyrus/">http://lists.andrew.cmu.edu/pipermail/info-cyrus/</a></div>
                        <div>
                                To Unsubscribe:</div>
                        <div>
                                <a href="https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus">https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus</a></div>
                </blockquote>
        </div>
</div>
<div>
        &nbsp;</div>
</div><div>-- </div>
<div>  Bron Gondwana</div>
<div>  <a href="mailto:brong@fastmail.fm">brong@fastmail.fm</a></div>
</body></html>