Re: [Dovecot] qpopper UIDLs and migrating to dovecot/maildir
OK, here's the patch against dovecot-1.0-stable. (I just applied it to dovecot-stable-20050901. My version of stable has a few more patches applied, so I needed to apply the patch to a clean version!) Best Wishes, Chris grant beattie wrote:
-- --+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+- Christopher Wakelin, c.d.wakelin@reading.ac.uk IT Services Centre, The University of Reading, Tel: +44 (0)118 378 8439 Whiteknights, Reading, RG6 2AF, UK Fax: +44 (0)118 975 3094 diff -ruN dovecot-1.0-stable.orig/src/master/mail-process.c dovecot-1.0-stable/src/master/mail-process.c --- dovecot-1.0-stable.orig/src/master/mail-process.c Tue Feb 8 10:30:11 2005 +++ dovecot-1.0-stable/src/master/mail-process.c Mon Sep 5 10:29:22 2005 @@ -220,6 +220,8 @@ env_put("FULL_FILESYSTEM_ACCESS=1"); if (set->pop3_no_flag_updates) env_put("POP3_NO_FLAG_UPDATES=1"); + if (set->pop3_reuse_xuidl) + env_put("POP3_REUSE_XUIDL=1"); if (set->mbox_dirty_syncs) env_put("MBOX_DIRTY_SYNCS=1"); if (set->mbox_very_dirty_syncs) diff -ruN dovecot-1.0-stable.orig/src/master/master-settings.c dovecot-1.0-stable/src/master/master-settings.c --- dovecot-1.0-stable.orig/src/master/master-settings.c Sun Aug 7 14:00:41 2005 +++ dovecot-1.0-stable/src/master/master-settings.c Mon Sep 5 10:29:22 2005 @@ -125,6 +125,7 @@ /* pop3 */ DEF(SET_BOOL, pop3_no_flag_updates), DEF(SET_BOOL, pop3_enable_last), + DEF(SET_BOOL, pop3_reuse_xuidl), DEF(SET_STR, pop3_uidl_format), DEF(SET_STR, pop3_client_workarounds), @@ -297,6 +298,7 @@ /* pop3 */ MEMBER(pop3_no_flag_updates) FALSE, MEMBER(pop3_enable_last) FALSE, + MEMBER(pop3_reuse_xuidl) FALSE, MEMBER(pop3_uidl_format) "%v.%u", MEMBER(pop3_client_workarounds) NULL, diff -ruN dovecot-1.0-stable.orig/src/master/master-settings.h dovecot-1.0-stable/src/master/master-settings.h --- dovecot-1.0-stable.orig/src/master/master-settings.h Mon Jan 31 16:37:55 2005 +++ dovecot-1.0-stable/src/master/master-settings.h Mon Sep 5 10:29:22 2005 @@ -96,6 +96,7 @@ /* pop3 */ int pop3_no_flag_updates; int pop3_enable_last; + int pop3_reuse_xuidl; const char *pop3_uidl_format; const char *pop3_client_workarounds; diff -ruN dovecot-1.0-stable.orig/src/pop3/commands.c dovecot-1.0-stable/src/pop3/commands.c --- dovecot-1.0-stable.orig/src/pop3/commands.c Sun May 8 10:45:32 2005 +++ dovecot-1.0-stable/src/pop3/commands.c Mon Sep 5 10:29:22 2005 @@ -489,6 +489,7 @@ struct var_expand_table *tab; struct mail *mail; string_t *str; + const char *xuidl; int ret, found = FALSE; tab = t_malloc(sizeof(static_tab)); @@ -532,7 +533,15 @@ str_truncate(str, 0); str_printfa(str, ctx->message == 0 ? "%u " : "+OK %u ", mail->seq); - var_expand(str, uidl_format, tab); + if (reuse_xuidl) { + xuidl=mail->get_header(mail, "X-UIDL"); + if (xuidl != NULL) + str_append(str, xuidl); + else + var_expand(str, uidl_format, tab); + } + else + var_expand(str, uidl_format, tab); ret = client_send_line(client, "%s", str_c(str)); t_pop(); diff -ruN dovecot-1.0-stable.orig/src/pop3/common.h dovecot-1.0-stable/src/pop3/common.h --- dovecot-1.0-stable.orig/src/pop3/common.h Mon Jan 31 16:37:55 2005 +++ dovecot-1.0-stable/src/pop3/common.h Mon Sep 5 10:29:22 2005 @@ -18,7 +18,7 @@ extern struct ioloop *ioloop; extern enum client_workarounds client_workarounds; -extern int enable_last_command, no_flag_updates; +extern int enable_last_command, no_flag_updates, reuse_xuidl; extern const char *uidl_format; extern enum uidl_keys uidl_keymask; diff -ruN dovecot-1.0-stable.orig/src/pop3/main.c dovecot-1.0-stable/src/pop3/main.c --- dovecot-1.0-stable.orig/src/pop3/main.c Mon Jan 31 16:37:55 2005 +++ dovecot-1.0-stable/src/pop3/main.c Mon Sep 5 10:29:22 2005 @@ -41,6 +41,7 @@ enum client_workarounds client_workarounds = 0; int enable_last_command = FALSE; int no_flag_updates = FALSE; +int reuse_xuidl = FALSE; const char *uidl_format; enum uidl_keys uidl_keymask; @@ -166,6 +167,7 @@ parse_workarounds(); enable_last_command = getenv("POP3_ENABLE_LAST") != NULL; no_flag_updates = getenv("POP3_NO_FLAG_UPDATES") != NULL; + reuse_xuidl = getenv("POP3_REUSE_XUIDL") != NULL; uidl_format = getenv("POP3_UIDL_FORMAT"); if (uidl_format == NULL)
participants (1)
-
Chris Wakelin