From: Timo Sirainen Date: Wed, 22 Oct 2014 21:15:23 +0000 (-0700) Subject: replication plugin: Use low priority for mail copying operations. X-Git-Tag: 2.2.15~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=10732e0d1013fb6a9e86b73381a830acbb335850;p=thirdparty%2Fdovecot%2Fcore.git replication plugin: Use low priority for mail copying operations. --- diff --git a/src/plugins/replication/replication-plugin.c b/src/plugins/replication/replication-plugin.c index 0220640d26..026505fa67 100644 --- a/src/plugins/replication/replication-plugin.c +++ b/src/plugins/replication/replication-plugin.c @@ -228,13 +228,20 @@ static void replication_mail_save(void *txn, struct mail *mail ATTR_UNUSED) ctx->new_messages = TRUE; } -static void replication_mail_copy(void *txn, struct mail *src ATTR_UNUSED, - struct mail *dst ATTR_UNUSED) +static void replication_mail_copy(void *txn, struct mail *src, + struct mail *dst) { struct replication_mail_txn_context *ctx = (struct replication_mail_txn_context *)txn; - ctx->new_messages = TRUE; + if (src->box->storage != dst->box->storage) { + /* copy between storages, e.g. new mail delivery */ + ctx->new_messages = TRUE; + } else { + /* copy within storage, which isn't as high priority since the + mail already exists. and especially copies to Trash or to + lazy-expunge namespace is pretty low priority. */ + } } static void