isync

mailbox synchronization program
git clone https://git.code.sf.net/p/isync/isync
Log | Files | Refs | README | LICENSE

commit d1c4f8a06949a2508c648ff1e8e76f183e959a80
parent 97f48f56ed49d566ce19b2fe4b5baedacc9d2ace
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date:   Thu,  2 Feb 2006 10:04:05 +0000

orphan/kill all affected entries after expunge

Diffstat:
Msrc/run-tests.pl | 2+-
Msrc/sync.c | 21++++++++++-----------
2 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/src/run-tests.pl b/src/run-tests.pl @@ -53,7 +53,7 @@ my @X03 = ( [ 10, 1, 1, "F", 2, 2, "F", 3, 3, "FS", 4, 4, "", 9, 10, "", 10, 9, "" ], [ 9, 0, 9, - 1, 1, "F", 2, 2, "F", 3, 3, "FS", 4, 4, "", 5, 5, "T", 6, 0, "", 7, 7, "T", 10, 9, "", 9, 10, "" ], + 1, 1, "F", 2, 2, "F", 3, 3, "FS", 4, 4, "", 5, 0, "T", 6, 0, "", 7, 0, "T", 10, 9, "", 9, 10, "" ], ); test(\@x01, \@X03); diff --git a/src/sync.c b/src/sync.c @@ -873,21 +873,20 @@ sync_boxes( store_t *ctx[], const char *names[], channel_conf_t *chan ) if (srec->status & S_DEAD) continue; if (srec->uid[S] <= 0 || ((srec->status & S_DEL(S)) && ex[S])) { - if (srec->uid[M] <= 0 || ((srec->status & S_DEL(M)) && ex[M])) { + if (srec->uid[M] <= 0 || ((srec->status & S_DEL(M)) && ex[M]) || + ((srec->status & S_EXPIRED) && maxuid[M] >= srec->uid[M] && minwuid > srec->uid[M])) { debug( " -> killing (%d,%d)\n", srec->uid[M], srec->uid[S] ); srec->status = S_DEAD; Fprintf( jfp, "- %d %d\n", srec->uid[M], srec->uid[S] ); - } else if (srec->status & S_EXPIRED) { - if (maxuid[M] >= srec->uid[M] && minwuid > srec->uid[M]) { - debug( " -> killing (%d,%d)\n", srec->uid[M], srec->uid[S] ); - srec->status = S_DEAD; - Fprintf( jfp, "- %d %d\n", srec->uid[M], srec->uid[S] ); - } else if (srec->uid[S]) { - debug( " -> orphaning (%d,[%d])\n", srec->uid[M], srec->uid[S] ); - Fprintf( jfp, "> %d %d 0\n", srec->uid[M], srec->uid[S] ); - srec->uid[S] = 0; - } + } else if (srec->uid[S] > 0) { + debug( " -> orphaning (%d,[%d])\n", srec->uid[M], srec->uid[S] ); + Fprintf( jfp, "> %d %d 0\n", srec->uid[M], srec->uid[S] ); + srec->uid[S] = 0; } + } else if (srec->uid[M] > 0 && ((srec->status & S_DEL(M)) && ex[M])) { + debug( " -> orphaning ([%d],%d)\n", srec->uid[M], srec->uid[S] ); + Fprintf( jfp, "< %d %d 0\n", srec->uid[M], srec->uid[S] ); + srec->uid[M] = 0; } } }