i_zero(&ctx->old->socket_set);
}
+static bool
+old_settings_handle_path(struct config_parser_context *ctx,
+ const char *key, const char *value)
+{
+ if (strcmp(str_c(ctx->str), "plugin/0/") == 0) {
+ if (strcmp(key, "imap_zlib_compress_level") == 0) {
+ obsolete(ctx, "%s has been replaced by imap_compress_deflate_level", key);
+ config_apply_line(ctx, key,
+ t_strdup_printf("plugin/0/imap_compress_deflate_level=%s", value), NULL);
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
bool old_settings_handle(struct config_parser_context *ctx,
enum config_line_type type,
const char *key, const char *value)
return old_settings_handle_root(ctx, key, value);
}
- break;
+ return old_settings_handle_path(ctx, key, value);
case CONFIG_LINE_TYPE_SECTION_BEGIN:
if (ctx->old->auth_section > 0)
return old_auth_section(ctx, key, value);
client_skip_line(client);
client_send_tagline(cmd, "OK Begin compression.");
- value = mail_user_plugin_getenv(client->user,
- "imap_zlib_compress_level");
- if (value == NULL || str_to_int(value, &level) < 0 ||
- level < handler->get_min_level() || level > handler->get_max_level()) {
- i_error("imap_zlib_compress_level: Level must be between %d..%d",
+ const char *setting = t_strdup_printf("imap_compress_%s_level",
+ handler->name);
+ value = mail_user_plugin_getenv(client->user, setting);
+ if (value == NULL) {
+ level = handler->get_default_level();
+ } else if (str_to_int(value, &level) < 0 ||
+ level < handler->get_min_level() ||
+ level > handler->get_max_level()) {
+ i_error("%s: Level must be between %d..%d",
+ setting,
handler->get_min_level(),
handler->get_max_level());
level = handler->get_default_level();