<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <pre wrap="">Hi again,

Almost there...
I found out that replacing in each cyrus.header file the ACL line "john.doe" by <a class="moz-txt-link-rfc2396E" href="mailto:john.doe@example.net">"john.doe@example.net"</a> did the trick ! Now <a class="moz-txt-link-rfc2396E" href="mailto:john.doe@example.net">"john.doe@example.net"</a> is the mailbox owner, and not "john.doe" anymore.

Everything works fine, except that now my log file is cluttered with :
Header CRC mismatch for mailbox example.net!user.john.doe

My questions :
- is there a way (other than messing with cyrus.header) to modify a mailbox owner ?
- if not, is there a way to rebuild cyrus.index, so it can take into account the new cyrus.header's CRC ? 

------------------------------

Message: 3
Date: Mon, 14 May 2018 22:00:53 +0100
From: Chentao Credungtao <a class="moz-txt-link-rfc2396E" href="mailto:chentaocredungtao@yahoo.com"><chentaocredungtao@yahoo.com></a>
To: <a class="moz-txt-link-abbreviated" href="mailto:info-cyrus@lists.andrew.cmu.edu">info-cyrus@lists.andrew.cmu.edu</a>
Subject: how can I check (and change) the owner of a mailbox ?
Message-ID: <a class="moz-txt-link-rfc2396E" href="mailto:235ebac8-d275-292e-8a6a-9f247fe51561@yahoo.com"><235ebac8-d275-292e-8a6a-9f247fe51561@yahoo.com></a>
Content-Type: text/plain; charset=utf-8; format=flowed

Hi,

How can I check who the mailbox owner is ? How can I change it ? I'd 
like to change owner john.doe to <a class="moz-txt-link-abbreviated" href="mailto:john.doe@example.net">john.doe@example.net</a>


Here's why :

I'm currently testing the migration of a single-domain Cyrus IMAP server 
to a multi-domain one. I'm doing the migration on the filesystem level, 
copying files from the old to the new server.

It works fine, except for the mailbox owner, it seems to be the old one, 
without the e-mail domain.


Here is what I did :

- 1/? First I created user/john.doe on domain example.net on the new 
server,? using autocreate (so it created 
/var/spool/cyrus/mail/domain/e/example.net/j/user/john.doe)

- 2/ The I checked this mailbox's ACLs :
$ cyradm --user <a class="moz-txt-link-abbreviated" href="mailto:cyrus@example.net">cyrus@example.net</a> localhost
localhost> lam user/john.doe
user/john.doe:
 ? <a class="moz-txt-link-abbreviated" href="mailto:john.doe@example.net">john.doe@example.net</a> lrswipkxtecdan

- 3/ Then I stopped cyrus

- 4/ Then I copied <i class="moz-txt-slash"><span class="moz-txt-tag">/</span>var/spool/cyrus/mail/j/john.doe<span class="moz-txt-tag">/</span></i>*? from the old 
(single domain) server to 
/var/spool/cyrus/mail/domain/e/example.net/j/user/john.doe on the new 
(multi-domain) server

- 5/ Then a little reconstruct : su -c "/usr/lib/cyrus/bin/reconstruct 
-r -f <a class="moz-txt-link-abbreviated" href="mailto:user/john.doe@example.net">user/john.doe@example.net</a>" cyrus -s /bin/bash

- 6/ Starting cyrus

- 7/ Checking ACLs :
$ cyradm --user <a class="moz-txt-link-abbreviated" href="mailto:cyrus@example.net">cyrus@example.net</a> localhost
Password:
localhost> lam user/john.doe
user/john.doe:
 ? john.doe lrswipkxtecda

- 8/ OK, so now john.doe (and not <a class="moz-txt-link-abbreviated" href="mailto:john.doe@example.net">john.doe@example.net</a> like before) 
seems to be the owner of user/john.doe

- 9/ When I try to log in (with my webmail for example), it doesn't 
work. From the logfiles :
May 14 21:40:04 sogod [1596]: [ERROR] 
<0x0x5648006b5480[NGImap4Connection]> could not select URL: 
imaps://john.doe%40example.net@mail/INBOX/: {RawResponse = 
"{ResponseResult = {description = \"Mailbox does not exist\"; result = 
no; tagId = 6; }; }"; reason = "Mailbox does not exist"; result = 0; }

- 10/ Back to cyradm, and granting full rights to <a class="moz-txt-link-abbreviated" href="mailto:john.doe@example.net">john.doe@example.net</a> :
$ cyradm --user <a class="moz-txt-link-abbreviated" href="mailto:cyrus@example.net">cyrus@example.net</a> localhost
Password:
localhost> sam user/john.doe* <a class="moz-txt-link-abbreviated" href="mailto:john.doe@example.net">john.doe@example.net</a> lrswipkxtecdan

- 11/ OK, after that webmail works fine.

- 12/ Back to cyradm, where my ACLs now look like :
$ cyradm --user <a class="moz-txt-link-abbreviated" href="mailto:cyrus@example.net">cyrus@example.net</a> localhost
Password:
localhost> lam user/john.doe
user/john.doe:
 ? john.doe lrswipkxtecda
 ? <a class="moz-txt-link-abbreviated" href="mailto:john.doe@example.net">john.doe@example.net</a> lrswipkxtecdan

So, I though I don't need the john.doe ACL anymore, and tried to remove it :

localhost> dam user/john.doe john.doe

But I still have "lkxca" ACLs, which are the owner's implicit ACLs :

localhost> lam user/john.doe
<a class="moz-txt-link-abbreviated" href="mailto:john.doe@example.net">john.doe@example.net</a> lrswipkxtecdan
john.doe lkxca

So I guess after the migration the owner of the mailbox is john.doe, and 
not <a class="moz-txt-link-abbreviated" href="mailto:john.doe@example.net">john.doe@example.net</a> like before the migration. How can I change 
this ? How can I get rid of john.doe's ACLs ?



Thanks,

Chen
</pre>
  </body>
</html>