Re: Cyrus imap 3.4.8: synchronizing local mailbox list with MUPDATE server does not work

"ellie timoney" <[email protected]>
Newsgroups gmane.mail.imap.cyrus
Message-ID <[email protected]>
Hi,

On Thu, 13 Jun 2024, at 8:46 PM, Michael Menge wrote:
> but as "ctl_mboxlist" is acting as a client i find it more suspicious  
> that "pin->isclient" was 0 and
> therefore the "if (pin->isclient && c == '+') {" block was skipped

Since ctl_mboxlist is acting as a client here, its input ("pin") is from the server, so I think it's correct that pin->isclient is 0 -- the server is not a client.  The client side of this connection is its output ("pout"), so pout->isclient ought to be 1.  But getxstring doesn't consider pout->isclient at all.

There's clearly something not quite right here but I'm not sure what yet.  We only consider '+' when the input is a client.  Maybe that's incorrect?  Or maybe it's correct, and the server end of this is behaving badly by sending '+' to a client...

RFC7888 <https://www.rfc-editor.org/rfc/rfc7888#section-3> says: "The non-synchronizing literal form MUST NOT be sent from server to client."

So I think getxstring's new pin->isclient behaviour is correct here, but is more strict than it used to be.  The other end is behaving badly and ctl_mboxlist no longer tolerates it.  Interesting.

Ahh yep.  static int sendupdate(const mbentry_t *mbentry, void *rock) in imap/mupdate.c is what sends the LIST response, and it has hardcoded '+' in all its literal outputs.  Perhaps this function sometimes outputs to a server, and sometimes to a client.  In which case it ought to check and omit the '+' when pout->isclient is true, and it might need to check for the LITERAL+ capability (or whatever it's called) when talking to a server.  But if it never talks to a server, then we should just remove the '+'s.

What's been baffling me so far though, is that our tests don't detect any problem.  But!  That's because our tests only run ctl_mboxlist -m on startup, before any mailboxes have been created, and the LIST response is empty.  As part of fixing this, I think I'll probably add a ctl_mboxlist -m call on each backend as part of our post-test sanity checks.  That should catch this sort of thing coming back in the future.

> Kind regards
>
>     Michael Menge

Thanks heaps for your initial diagnosis, that was a big help!

Cheers,

ellie
------------------------------------------
Cyrus: Info
Permalink: https://cyrus.topicbox.com/groups/info/T5a7b6ffa3591f516-Mca05d744c8ad592e373cb15a
Delivery options: https://cyrus.topicbox.com/groups/info/subscription
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.