On Tue, 05 May 2026 at 11:52:55 +0200, Oswald Buddenhagen wrote:
> On Tue, May 05, 2026 at 06:14:07PM +1000, Seth McDonald wrote:
> > And this opening logic includes creating the mailbox
> > if it doesn't exist, thereby skipping the proxy's creation logic and
> > messing with the is_fake logic.
> > 
> whoopsie, this is actually true ... for INBOX, which is magically always
> there (the IMAP spec says so, and we want consistent behavior across mailbox
> formats).
> 
> so clearly, the maildir_validate() call in maildir_open_box() needs to take
> DRYRUN into account, and maybe some more.

In that case, a quick fix for the issue could be a patch like this
(diff'ed against current master):

=== BEGIN PATCH ===
diff --git i/src/drv_maildir.c w/src/drv_maildir.c
index fe0e95140703..5ff9e22f1f51 100644
--- i/src/drv_maildir.c
+++ w/src/drv_maildir.c
@@ -1281,7 +1281,7 @@ maildir_open_box( store_t *gctx,
        int ret;
        char uvpath[_POSIX_PATH_MAX];
 
-       if ((ret = maildir_validate( ctx->path, ctx->is_inbox, ctx )) != DRV_OK)
+       if ((ret = maildir_validate( ctx->path, (DFlags & DRYRUN) ? 0 : 
ctx->is_inbox, ctx )) != DRV_OK)
                goto bail;
 
        nfsnprintf( uvpath, sizeof(uvpath), "%s/.uidvalidity", ctx->path );
=== END PATCH ===

The main impact of the "INBOX" mailbox here is toggling ctx->is_inbox
on, which is used here to tell maildir_validate() whether to create the
mailbox if it doesn't already exist.  So by instead telling
maildir_validate() to never create regardless of the value of
ctx->is_inbox, we steer back towards the expected behaviour.

Take care,
        Seth McDonald.

-- 
E9D1 26A5 F0D4 9DF7 792B  C2E2 B4BF 4530 D39B 2D51


_______________________________________________
isync-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to