From 9e186ae88ba72f249ac3f5916f2ba90be936da35 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Sat, 9 Nov 2013 11:25:40 +0100 Subject: [PATCH] use post-sync "seen" flag to determine expirability otherwise it wouldn't be idempotent. --- src/sync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sync.c b/src/sync.c index ef43267..bc2f1a4 100644 --- a/src/sync.c +++ b/src/sync.c @@ -1380,7 +1380,7 @@ box_loaded( int sts, void *aux ) if (nflags & F_FLAGGED) { /* Flagged messages are always kept. */ todel--; - } else if ((tmsg->flags & F_SEEN) && + } else if ((nflags & F_SEEN) && (todel > 0 || ((srec->status & (S_EXPIRE|S_EXPIRED)) == (S_EXPIRE|S_EXPIRED)) || ((srec->status & (S_EXPIRE|S_EXPIRED)) && (tmsg->flags & F_DELETED)))) {