Browse Source

make sure we fetch source flags when expiring while pulling new

otherwise important messages may be incorrectly aborted.
wip/maildir-path-under-inbox
Oswald Buddenhagen 3 years ago
parent
commit
e6a15bee59
  1. 7
      src/run-tests.pl
  2. 2
      src/sync.c

7
src/run-tests.pl

@ -1251,20 +1251,21 @@ my @x35 = (
A, "*F", "*F", "*F", A, "*F", "*F", "*F",
B, "*", "*", "*", B, "*", "*", "*",
C, "*", "", "", C, "*", "", "",
D, "*", "", "", D, "*F", "", "",
E, "*", "", "", E, "*", "", "",
F, "*", "", "", F, "*", "", "",
G, "*", "", "", G, "*", "", "",
H, "*", "", "", H, "*F", "", "",
); );
my @O35 = ("", "", "Sync New\nMaxMessages 3\nExpireUnread yes\n"); my @O35 = ("", "", "Sync New\nMaxMessages 3\nExpireUnread yes\n");
my @X35 = ( my @X35 = (
H, E, H, H, E, H,
B, "", "+~", "+T", B, "", "+~", "+T",
D, "", "*F", "*F",
F, "", "*", "*", F, "", "*", "*",
G, "", "*", "*", G, "", "*", "*",
H, "", "*", "*", H, "", "*F", "*F",
); );
test("max messages + expire - too many new", \@x35, \@X35, \@O35); test("max messages + expire - too many new", \@x35, \@X35, \@O35);

2
src/sync.c

@ -792,6 +792,8 @@ box_opened2( sync_vars_t *svars, int t )
svars->any_expiring = 1; svars->any_expiring = 1;
if (svars->any_expiring) { if (svars->any_expiring) {
opts[N] |= OPEN_OLD | OPEN_FLAGS; opts[N] |= OPEN_OLD | OPEN_FLAGS;
if (chan->ops[N] & (OP_NEW | OP_RENEW))
opts[F] |= OPEN_FLAGS;
} }
svars->opts[F] = svars->drv[F]->prepare_load_box( ctx[F], opts[F] ); svars->opts[F] = svars->drv[F]->prepare_load_box( ctx[F], opts[F] );
svars->opts[N] = svars->drv[N]->prepare_load_box( ctx[N], opts[N] ); svars->opts[N] = svars->drv[N]->prepare_load_box( ctx[N], opts[N] );

Loading…
Cancel
Save