Hello Lázár,

you can convert the mailboxes database to flat (text) format with
cvt_cyrusdb , modify it, and then convert it back to the original
format.  This way ctl_mboxlist is not used.

> Why neither 2.5.10 or 2.5.17 tarball don't contains the mentioned
patch?

Why don’t you upgrade?

Greetings
  Дилян


On Tue, 2021-03-30 at 15:20 +0200, Lázár Imre wrote:
> Hi,
> Thanks your reply, it moves me a bit forward.
> Probably my problem was solved in:
> commit ef0c4f10e897ec766e826b08cb6d75e49b68615a
> Author: Ken Murchison <mu...@andrew.cmu.edu>
> Date:   Fri Oct 16 08:32:20 2015 -0400
> 
>     ctl_mboxlist.c: properly dump/undump location field
> (server!partition) for proxy servers
> so it's on master since Oct. 2015.
> I only checked the tarball release date for 2.5.10, which is Aug 31
> 2018:
> (https://github.com/cyrusimap/cyrus-imapd/releases/tag/cyrus-imapd-2.5.10
> , elliefm released this on Aug 31 2018)
> So I assumed that the modification from 2015 must be in it, but it
> isn't.
> I've downloaded the latest 2.5.17 tarball from here:
> https://github.com/cyrusimap/cyrus-imapd/releases/tag/cyrus-imapd-2.5.17
> elliefm released this 21 days ago 
> and this still doesn't contains the desired modification from Ken
> Murchinson:
> In the tarball:
>     case DUMP:
>     if (!d->partition || !strcmpsafe(d->partition, mbentry-
> >partition)) {
>         printf("%s\t%d %s %s\n", mbentry->name, mbentry->mbtype,
>                      mbentry->partition, mbentry->acl);
>         if (d->purge) {
>         mboxlist_delete(mbentry->name, 0);
>         }
>     }
> My desired patch:
> commit ef0c4f10e897ec766e826b08cb6d75e49b68615a
> Author: Ken Murchison <mu...@andrew.cmu.edu>
> Date:   Fri Oct 16 08:32:20 2015 -0400
> 
>     ctl_mboxlist.c: properly dump/undump location field
> (server!partition) for proxy servers
> 
> diff --git a/imap/ctl_mboxlist.c b/imap/ctl_mboxlist.c
> index 4ac3b95bb..f6e9f5a43 100644
> --- a/imap/ctl_mboxlist.c
> +++ b/imap/ctl_mboxlist.c
> @@ -178,8 +178,9 @@ static int dump_cb(const mbentry_t *mbentry, void
> *rockp)
>      switch (d->op) {
>      case DUMP:
>          if (!d->partition || !strcmpsafe(d->partition, mbentry-
> >partition)) {
> -            printf("%s\t%d %s %s\n", mbentry->name, mbentry->mbtype,
> -                                     mbentry->partition, mbentry-
> >acl);
> +            printf("%s\t%d ", mbentry->name, mbentry->mbtype);
> +            if (mbentry->server) printf("%s!", mbentry->server);
> +            printf("%s %s\n", mbentry->partition, mbentry->acl);
>              if (d->purge) {
>                  mboxlist_delete(mbentry->name, 0);
>              }
> 
> This is a bit confusing.
> Why neither 2.5.10 or 2.5.17 tarball don't contains the mentioned
> patch?
> I've built 2.5.17 from tarball, noticed the faulty behavior,
> obviously:
> imre@main:~/work/cyrus-imapd-2.5.17$ sudo imap/ctl_mboxlist -d | grep
> imre@ill
> illusion.hu!user.imre   1 common i...@illusion.hu       lrswipkxtecda
> The git master works properly:
> imre@main:~/work/cyrus-imapd$ sudo imap/ctl_mboxlist -d |grep
> imre@ill
> illusion.hu!user.imre   1 cyrus-common!common i...@illusion.hu 
> lrswipkxtecda
> I've also tried your PR 3384, which dumps a bit more information:
> imre@main:~/work/cyrus-imapd$ imap/ctl_mboxlist -f
> /home/imre/mailboxes.db -d | grep imre@ill
> illusion.hu!user.imre   1 cyrus-common!common i...@illusion.hu 
> lrswipkxtecda   >(null) 0 0 0 0 (null)
> 
> Is it safe to use the ctl_mboxlist built from master on a 2.5.10
> Ubuntu built in prod environment?
> If not, I assume that I have to build my own Ubuntu package with only
> that one patch.
> 
> I'm just wondering how many bugfixes still missing in pre-build
> packages.
> i.
> 2021.03.30. 12:33 keltezéssel, Дилян Палаузов írta:
> 
> > 
> > Hello,
> > 
> > you do not want to do this, since ctl_mboxlist does not export all
> > fields in the database.  So if you export, modify and import, some
> > fields are gone.  Moreover I do not think this shall be modified on
> > the murder server.  Rather the instances shall put changes to the
> > murder server, when it comes to the mboxlist.
> > 
> > On this occasion you might want to
> > apply https://github.com/cyrusimap/cyrus-imapd/pull/3384 to modify
> > your ctl_mboxlist and see if the patch makes problems.
> > 
> > I cannot tell you why is ->server empty.  You can try with
> > cvt_cyrusdb and convert to flat.  It is not specific to the mailbox
> > database and extracts whatever is in the store.
> > 
> > Version 2.5.10 was released in 2016.  I recommend you to see if
> > more recent versions can handle your case.
> > 
> > Greetings
> >   Дилян
> > 
> > On Tue, 2021-03-30 at 02:05 -0400, i...@illusion.hu wrote:
> > 
> > > Hi,
> > > 
> > > I have a discrete cyrus setup with two frontends, several
> > > backends and a single murder.
> > > 
> > > On the murder server I would like to dump out the mailboxes.db
> > > into a plain file, for doing sed/grep modifications then push it
> > > back. I'm facing with an inconsistence where the dump made on
> > > murder does not contains the backend's hostname.
> > > 
> > > on murder :
> > > ctl_mboxlist -d |grep 'my own mailbox'
> > > illusion.hu!user.imre   1 common i...@illusion.hu      
> > > lrswipkxtecda
> > > It tells me that is a remote (1) mailbox on partition common. But
> > > on which backend host?
> > > 
> > > on backend:
> > > ctl_mboxlist -d
> > > illusion.hu!user.imre   0 common i...@illusion.hu      
> > > lrswipkxtecda
> > > looks good, it's a local mailbox on common partition
> > > 
> > > on frontend:
> > > ctl_mboxlist -d
> > > illusion.hu!user.imre   1 cyrus-common!common i...@illusion.hu 
> > > lrswipkxtecda
> > > looks good, it's remote (1) on host 'cyrus-common' on partition
> > > 'common'
> > > 
> > > On murder the mailboxes.db does contain the missing information.
> > > I converted to db file to flat, got this:
> > > illusion.hu!user.imre   1 cyrus-common!common
> > > i...@illusion.hu<FF><89>lrswipkxtecda<FF><89>
> > > 
> > > On murder I'm using 2.5.10-3ubuntu1.1 version (ubuntu Bionic
> > > build)
> > > 
> > > I digged into the code, imap/ctl_mboxlist.c +183:
> > >     case DUMP:
> > >         if (!d->partition || !strcmpsafe(d->partition, mbentry-
> > > >partition)) {
> > >             printf("%s\t%d ", mbentry->name, mbentry->mbtype);
> > >             if (mbentry->server) printf("%s!", mbentry->server);
> > >             printf("%s %s\n", mbentry->partition, mbentry->acl);
> > >             if (d->purge) {
> > >                 mboxlist_delete(mbentry->name);
> > >             }
> > >         }
> > > 
> > > how can the mbentry->server be empty in my case?
> > > 
> > > The site is operational, it works fine in live, but after a
> > > dump/undump in murder all my clients started to complain about
> > > dissappeared mailboxes. That made evidence that the frontend
> > > configurated properly, using the murder's database as a master.
> > > 
> > > This problem is serious for us:
> > >  - one of our backend has destroyed, we need to purge the unused
> > > mailboxes from database
> > >  - we want to change the hostname of a backend and want to avoid
> > > mailbox deletion after 'mupdate -m'
> > >  - our mailboxes.db backup on murder is useless.
> > > 
> > > Please give me advices how to handle this case. If any detailed
> > > information is needed I'm happy to send.
> > 
> > Cyrus / Devel / see discussions + participants + delivery options
> > Permalink

------------------------------------------
Cyrus: Devel
Permalink: 
https://cyrus.topicbox.com/groups/devel/T3385011873ad329c-Mfa3728dfd798432abc5a0429
Delivery options: https://cyrus.topicbox.com/groups/devel/subscription

Reply via email to