From d461a91e5eb2270e77f4276f0268ba1eede6a08d Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 19 Jul 2010 19:19:29 +0100 Subject: [PATCH] config: Handle obsolete imap_client_workarounds --- src/config/config-parser.c | 6 +++++- src/config/old-set-parser.c | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/config/config-parser.c b/src/config/config-parser.c index 5c0f9370dd..7d06021600 100644 --- a/src/config/config-parser.c +++ b/src/config/config-parser.c @@ -783,6 +783,7 @@ int config_parse_file(const char *path, bool expand_values, const char *module, enum config_line_type type; char *line; int fd, ret = 0; + bool handled; fd = open(path, O_RDONLY); if (fd < 0) { @@ -829,7 +830,10 @@ prevfile: &key, &value); str_truncate(ctx.str, ctx.pathlen); - if (!old_settings_handle(&ctx, type, key, value)) + T_BEGIN { + handled = old_settings_handle(&ctx, type, key, value); + } T_END; + if (!handled) config_parser_apply_line(&ctx, type, key, value); if (ctx.error != NULL) { diff --git a/src/config/old-set-parser.c b/src/config/old-set-parser.c index d7362c32b0..76b10abf91 100644 --- a/src/config/old-set-parser.c +++ b/src/config/old-set-parser.c @@ -145,6 +145,24 @@ old_settings_handle_root(struct config_parser_context *ctx, set_rename(ctx, key, "mdbox_rotate_size", value); return TRUE; } + if (strcmp(key, "imap_client_workarounds") == 0) { + char **args, **arg; + + args = p_strsplit_spaces(pool_datastack_create(), value, " ,"); + for (arg = args; *arg != NULL; arg++) { + if (strcmp(*arg, "outlook-idle") == 0) { + *arg = ""; + obsolete(ctx, "imap_client_workarounds=outlook-idle is no longer necessary"); + } else if (strcmp(*arg, "netscape-eoh") == 0) { + *arg = ""; + obsolete(ctx, "imap_client_workarounds=netscape-eoh is no longer supported"); + } + } + value = t_strarray_join((void *)args, " "); + config_parser_apply_line(ctx, CONFIG_LINE_TYPE_KEYVALUE, + key, value); + return TRUE; + } if (strcmp(key, "login_dir") == 0 || strcmp(key, "dbox_rotate_min_size") == 0 || -- 2.47.3