On Fri, 11 Jun 2021, at 7:55 PM, [email protected] <mailto:glad%40au.dk> wrote:
> I've found https://github.com/cyrusimap/cyrus-imapd/issues/2383 (Xfer for a
> single mailbox doesn't work) which seems to describe the issue. The page
> contains a patch that was merged in cyrus v3.0. May be that patch was what
> saved me earlier -- I can't remember exactly.
>
> Was the patch included in later versions? The corresponding line in version
> 3.4.1 seems to be line 12029 in "imap/imapd.c":
>
> mboxlist_findall(NULL, mbname_intname(mbname), 1, NULL, NULL, xfer_addmbox,
> &list);
Ahh, good find! Even though I'm the one who merged it, it was a long time ago
and I don't really remember it.
We don't have any regression tests for XFER at all, so maybe I only merged the
patch to 3.0 because that was the only branch for which we had confirmation
(from the submitter) that it worked correctly? The API has changed subtly in
here over time, and I'm not sure if the same shape of fix will work now. And
without regression tests, I can't just try it and see what happens.
imap/imapd.c:12029 does look like the line that needs fixing though. One of
these might work?
mboxlist_findall(NULL, name, 1, NULL, NULL, xfer_addmbox, &list);
(i.e. basically the same fix as was used for 3.0, changing intname->name, but
it smells bad to me)
mboxlist_findall(&imapd_namespace, mbname_intname(mbname), 1, NULL,
NULL, xfer_addmbox, &list);
(i.e. provide the current namespace, in which case maybe the intname will work
now)
I'm pretty sure doing both changes at once won't work, but maybe one or the
other might...
I'm also struggling to find any specification at all for how XFER is supposed
to work, which makes it difficult to debug or write tests, because I don't know
what success is supposed to look like. I wonder if it was once documented, but
was lost during the big RST converstion? If you have any
documentation/links/bookmarks/etc about it, however ancient (how do you know it
exists, for example?), that'd be very helpful.
> I don't know if I run a toxic combo of virtdomains, altnamespace, and
> unixhierarchysep. I suppose that other admins are able to xfer users?
>From your earlier email:
unixhierarchysep: yes
altnamespace: yes
virtdomains: no
This all seems fine, and it's supposed to work correctly in this configuration,
but XFER is clearly broken. Long term I'd suggest migrating to "virtdomains:
userid" (see: https://github.com/cyrusimap/cyrus-imapd/issues/2847), but I
don't think it's affecting anything here.
The next steps are probably figuring out how it's supposed to work, writing
regression tests that prove it's okay on 2.5 and 3.0 but broken on 3.2 and
later, and then figuring out how to fix it so that it works correctly on the
later versions too. Unless one of those one-line changes I suggested earlier
happens to work -- though it'd still be nice to have regression tests for next
time!
Cheers,
ellie
------------------------------------------
Cyrus: Info
Permalink:
https://cyrus.topicbox.com/groups/info/T8048e7fe94e775f9-M18eb3292c8f6a21561200b2b
Delivery options: https://cyrus.topicbox.com/groups/info/subscription