dovecot-2.2: dsync: Preserve pop3 ordering.

dovecot at dovecot.org dovecot at dovecot.org
Sun May 20 03:26:30 EEST 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/7ae930911a74
changeset: 14400:7ae930911a74
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Mar 30 04:25:46 2012 +0300
description:
dsync: Preserve pop3 ordering.
This is currently done only when syncing locally, because it's not easy to
add more fields for the current dsync proxying protocol in backwards
compatible way. dsync redesign should fix this.

diffstat:

 src/doveadm/dsync/dsync-data.h         |  1 +
 src/doveadm/dsync/dsync-worker-local.c |  6 ++++++
 2 files changed, 7 insertions(+), 0 deletions(-)

diffs (41 lines):

diff -r 82cd7aa65faf -r 7ae930911a74 src/doveadm/dsync/dsync-data.h
--- a/src/doveadm/dsync/dsync-data.h	Fri Mar 30 04:23:59 2012 +0300
+++ b/src/doveadm/dsync/dsync-data.h	Fri Mar 30 04:25:46 2012 +0300
@@ -51,6 +51,7 @@
 
 struct dsync_msg_static_data {
 	const char *pop3_uidl;
+	unsigned int pop3_order;
 	time_t received_date;
 	struct istream *input;
 };
diff -r 82cd7aa65faf -r 7ae930911a74 src/doveadm/dsync/dsync-worker-local.c
--- a/src/doveadm/dsync/dsync-worker-local.c	Fri Mar 30 04:23:59 2012 +0300
+++ b/src/doveadm/dsync/dsync-worker-local.c	Fri Mar 30 04:25:46 2012 +0300
@@ -1717,6 +1717,8 @@
 					   save_ctx, msg);
 	if (*data->pop3_uidl != '\0')
 		mailbox_save_set_pop3_uidl(save_ctx, data->pop3_uidl);
+	if (data->pop3_order > 0)
+		mailbox_save_set_pop3_order(save_ctx, data->pop3_order);
 
 	mailbox_save_set_received_date(save_ctx, data->received_date, 0);
 
@@ -1793,6 +1795,7 @@
 	struct dsync_msg_static_data data;
 	struct mailbox_transaction_context *trans;
 	struct mailbox *box;
+	const char *value;
 
 	i_assert(!worker->reading_mail);
 
@@ -1824,6 +1827,9 @@
 		data.pop3_uidl = "";
 	else
 		data.pop3_uidl = t_strdup(data.pop3_uidl);
+	if (mail_get_special(worker->get_mail, MAIL_FETCH_POP3_ORDER, &value) < 0 ||
+	    str_to_uint(value, &data.pop3_order) < 0)
+		data.pop3_order = 0;
 	if (mail_get_received_date(worker->get_mail, &data.received_date) < 0 ||
 	    mail_get_stream(worker->get_mail, NULL, NULL, &data.input) < 0) {
 		get->callback(worker->get_mail->expunged ?


More information about the dovecot-cvs mailing list