]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
replication plugin: Use low priority for mail copying operations.
authorTimo Sirainen <tss@iki.fi>
Wed, 22 Oct 2014 21:15:23 +0000 (14:15 -0700)
committerTimo Sirainen <tss@iki.fi>
Wed, 22 Oct 2014 21:15:23 +0000 (14:15 -0700)
src/plugins/replication/replication-plugin.c

index 0220640d26dbc270aa03ef0588bf81b7adede94f..026505fa67b0c1a78a171aa55d013139a70068d6 100644 (file)
@@ -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