From 15216947fbc1a385d9dcca9e61bccd77ed86b58a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 8 Nov 2013 12:05:08 +0100 Subject: [PATCH] don't protect recent messages from MaxMessages while maildir has a clearly defined meaning of "recent" and for example mutt handles it graciously, IMAP's definition is fubared to the point that some servers (for example gmail) simply refuse to support it. for symmetry reasons it is best to pretend that it doesn't exist at all. it doesn't seem too useful anyway (the user can simply mark the messages as read to allow pruning). and last but not least, the man page of mbsync says nothing about "recent", only "unread". unlike the isync man page, though. --- src/compat/isync.1 | 2 +- src/sync.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compat/isync.1 b/src/compat/isync.1 index 7c176d3..c8ed9f3 100644 --- a/src/compat/isync.1 +++ b/src/compat/isync.1 @@ -220,7 +220,7 @@ This is useful for mailboxes where you keep a complete archive on the server, but want to mirror only the last messages (for instance, for mailing lists). The messages that were the first to arrive in the mailbox (independently of the actual date of the message) will be deleted first. -Messages that are flagged (marked as important) and recent messages will not be +Messages that are flagged (marked as important) and unread messages will not be automatically deleted. If \fIcount\fR is 0, the maximum number of messages is \fBunlimited\fR. (Default: 0) diff --git a/src/sync.c b/src/sync.c index e7ce2d1..ef43267 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->status & M_RECENT) || (tmsg->flags & F_SEEN)) && + } else if ((tmsg->flags & F_SEEN) && (todel > 0 || ((srec->status & (S_EXPIRE|S_EXPIRED)) == (S_EXPIRE|S_EXPIRED)) || ((srec->status & (S_EXPIRE|S_EXPIRED)) && (tmsg->flags & F_DELETED)))) {