isync

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

commit c7903f800314c7c90566b9554c79e1e1734c04bb
parent b5d70aa5962ec915dd209825b122099c28eb6981
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date:   Tue, 21 Mar 2006 16:03:09 +0000

don't enter trash loop if not trashing at all. also, move expunge
message where it belongs. not adding info("trashing"), as it will be
replaced in a moment anyway.

Diffstat:
Msrc/sync.c | 10++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/sync.c b/src/sync.c @@ -1072,9 +1072,9 @@ sync_boxes( store_t *ctx[], const char *names[], channel_conf_t *chan ) } for (t = 0; t < 2; t++) { - if (svars->chan->ops[t] & OP_EXPUNGE) { - info( "Expunging %s\n", str_ms[t] ); - debug( "expunging %s\n", str_ms[t] ); + if ((svars->chan->ops[t] & OP_EXPUNGE) && + (svars->ctx[t]->conf->trash || (svars->ctx[1-t]->conf->trash && svars->ctx[1-t]->conf->trash_remote_new))) { + debug( "trashing in %s\n", str_ms[t] ); for (tmsg = svars->ctx[t]->msgs; tmsg; tmsg = tmsg->next) if (tmsg->flags & F_DELETED) { if (svars->ctx[t]->conf->trash) { @@ -1087,7 +1087,7 @@ sync_boxes( store_t *ctx[], const char *names[], channel_conf_t *chan ) } } else debug( " not trashing message %d - not new\n", tmsg->uid ); - } else if (svars->ctx[1-t]->conf->trash && svars->ctx[1-t]->conf->trash_remote_new) { + } else { if (!tmsg->srec || tmsg->srec->uid[1-t] < 0) { if (!svars->ctx[1-t]->conf->max_size || tmsg->size <= svars->ctx[1-t]->conf->max_size) { debug( " remote trashing message %d\n", tmsg->uid ); @@ -1104,6 +1104,8 @@ sync_boxes( store_t *ctx[], const char *names[], channel_conf_t *chan ) } } + info( "Expunging %s...\n", str_ms[t] ); + debug( "expunging %s\n", str_ms[t] ); switch (svars->drv[t]->close( svars->ctx[t] )) { case DRV_OK: svars->state[t] |= ST_DID_EXPUNGE; break; case DRV_STORE_BAD: svars->ret = SYNC_BAD(t); goto finish;