old-set-parser.c revision 2ac5f36aa7c2e7a07ba8815d43a6d7483f62e74c
02c335c23bf5fa225a467c19f2c063fb0dc7b8c3Timo Sirainen/* Copyright (c) 2009-2016 Dovecot authors, see the included COPYING file */
42cb779853b1814d7ab052436b0b6d1f507c742bAki Tuomistatic const char *ssl_dh_parameters;
e34d170f8f0e084bd94bfbc1a7085ece67e508dfTimo Sirainen#define config_apply_line (void)config_apply_line
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen /* 1 when in auth {} section, >1 when inside auth { .. { .. } } */
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen /* 1 when in socket listen {}, >1 when inside more of its sections */
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainenstatic const struct config_filter any_filter = {
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainenstatic const struct config_filter imap_filter = {
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainenstatic const struct config_filter pop3_filter = {
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainenstatic const struct config_filter managesieve_filter = {
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainenobsolete(struct config_parser_context *ctx, const char *str, ...)
66fbbac231b0385273b11f9b4c43ad252330dea5Timo Sirainen i_warning("NOTE: You can get a new clean config file with: "
66fbbac231b0385273b11f9b4c43ad252330dea5Timo Sirainen "doveconf -n > dovecot-new.conf");
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen ctx->cur_input->path, ctx->cur_input->linenum,
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainenstatic void set_rename(struct config_parser_context *ctx,
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen const char *old_key, const char *key, const char *value)
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen obsolete(ctx, "%s has been renamed to %s", old_key, key);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen config_parser_apply_line(ctx, CONFIG_LINE_TYPE_KEYVALUE, key, value);
42cb779853b1814d7ab052436b0b6d1f507c742bAki Tuomibool old_settings_ssl_dh_load(const char **value, const char **error_r)
42cb779853b1814d7ab052436b0b6d1f507c742bAki Tuomi if (ssl_dh_parameters != NULL) *value = ssl_dh_parameters;
42cb779853b1814d7ab052436b0b6d1f507c742bAki Tuomi const char *fn = t_strconcat(PKG_STATEDIR, "/ssl-parameters.dat", NULL);
42cb779853b1814d7ab052436b0b6d1f507c742bAki Tuomi buffer_t *data = buffer_create_dynamic(pool_datastack_create(), 300);
42cb779853b1814d7ab052436b0b6d1f507c742bAki Tuomi unsigned short keysize;
42cb779853b1814d7ab052436b0b6d1f507c742bAki Tuomi unsigned int off=0;
42cb779853b1814d7ab052436b0b6d1f507c742bAki Tuomi /* try read it */
42cb779853b1814d7ab052436b0b6d1f507c742bAki Tuomi struct istream *is = i_stream_create_file(fn, IO_BLOCK_SIZE);
42cb779853b1814d7ab052436b0b6d1f507c742bAki Tuomi /* this is given because the ssl-parameters.dat file is no more there
42cb779853b1814d7ab052436b0b6d1f507c742bAki Tuomi and we don't want to to make go searching for the file
42cb779853b1814d7ab052436b0b6d1f507c742bAki Tuomi this code is only ever reached if ssl_dh_parameters is empty anyways
551f3b2ebd588ca125c01f49b54c4103fbd5b2c5Aki Tuomi /* check moved to correct place from here */
42cb779853b1814d7ab052436b0b6d1f507c742bAki Tuomi /* then try to read the rest of the data */
42cb779853b1814d7ab052436b0b6d1f507c742bAki Tuomi const unsigned char *buf = i_stream_get_data(is, &siz);
42cb779853b1814d7ab052436b0b6d1f507c742bAki Tuomi str_append(b64_data, "-----BEGIN DH PARAMETERS-----\n");
42cb779853b1814d7ab052436b0b6d1f507c742bAki Tuomi /* need to wrap the string nicely */
42cb779853b1814d7ab052436b0b6d1f507c742bAki Tuomi for(size_t i = 29+65; i < str_len(b64_data); i+=64) /* start at header + first 64 */
42cb779853b1814d7ab052436b0b6d1f507c742bAki Tuomi str_append(b64_data, "-----END DH PARAMETERS-----");
42cb779853b1814d7ab052436b0b6d1f507c742bAki Tuomi i_warning("please set ssl_dh=<%s", SYSCONFDIR"/dh.pem");
42cb779853b1814d7ab052436b0b6d1f507c742bAki Tuomi i_warning("You can generate it with: dd if=%s bs=1 skip=%u | openssl dh -inform der > %s", fn, off, SYSCONFDIR"/dh.pem");
551f3b2ebd588ca125c01f49b54c4103fbd5b2c5Aki Tuomi /* check for empty ssl_dh elsewhere */
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainenold_settings_handle_root(struct config_parser_context *ctx,
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen const char *p;
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen ctx->old->base_dir = p_strdup(ctx->pool, value);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen protos = p_strsplit_spaces(pool_datastack_create(), value, " ");
bc85ab91357eaf47c789179362ee36f4f4f4abd7Timo Sirainen *s = "sieve";
bc85ab91357eaf47c789179362ee36f4f4f4abd7Timo Sirainen obsolete(ctx, "protocols=managesieve has been renamed to protocols=sieve");
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen value = t_strarray_join((const char *const *)protos, " ");
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen /* ugly way to drop extra spaces.. */
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen protos = p_strsplit_spaces(pool_datastack_create(), value, " ");
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen value = t_strarray_join((const char *const *)protos, " ");
bc4cb06efd149ff759ad5462c6cd1a352f735034Timo Sirainen obsolete(ctx, "'imaps' protocol can no longer be specified (use protocols=imap). to disable non-ssl imap, use service imap-login { inet_listener imap { port=0 } }");
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen "service/imap-login/inet_listener/imap/port=0", NULL);
e4ff3c71af029c7e63852cffc59c2352610d73a9Timo Sirainen obsolete(ctx, "'imaps' protocol is no longer necessary, remove it");
bc4cb06efd149ff759ad5462c6cd1a352f735034Timo Sirainen obsolete(ctx, "'pop3s' protocol can no longer be specified (use protocols=pop3). to disable non-ssl pop3, use service pop3-login { inet_listener pop3 { port=0 } }");
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen "service/pop3-login/inet_listener/pop3/port=0", NULL);
e4ff3c71af029c7e63852cffc59c2352610d73a9Timo Sirainen obsolete(ctx, "'pop3s' protocol is no longer necessary, remove it");
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen config_parser_apply_line(ctx, CONFIG_LINE_TYPE_KEYVALUE,
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen obsolete(ctx, "%s has been replaced by %s = <file", key, p);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen config_parser_apply_line(ctx, CONFIG_LINE_TYPE_KEYFILE,
42cb779853b1814d7ab052436b0b6d1f507c742bAki Tuomi if (strcmp(key, "ssl_parameters_regenerate") == 0 ||
ba8a3fbee3f8fca8e481ba929bce6b78296a7820Timo Sirainen obsolete(ctx, "sieve_storage has been moved into plugin { sieve_dir }");
ba8a3fbee3f8fca8e481ba929bce6b78296a7820Timo Sirainen obsolete(ctx, "%s has been moved into plugin {} section", key);
ba8a3fbee3f8fca8e481ba929bce6b78296a7820Timo Sirainen t_strdup_printf("plugin/%s=%s", key, value), NULL);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen set_rename(ctx, key, "mdbox_rotate_size", value);
d461a91e5eb2270e77f4276f0268ba1eede6a08dTimo Sirainen if (strcmp(key, "imap_client_workarounds") == 0) {
d461a91e5eb2270e77f4276f0268ba1eede6a08dTimo Sirainen args = p_strsplit_spaces(pool_datastack_create(), value, " ,");
d461a91e5eb2270e77f4276f0268ba1eede6a08dTimo Sirainen obsolete(ctx, "imap_client_workarounds=outlook-idle is no longer necessary");
d461a91e5eb2270e77f4276f0268ba1eede6a08dTimo Sirainen } else if (strcmp(*arg, "netscape-eoh") == 0) {
d461a91e5eb2270e77f4276f0268ba1eede6a08dTimo Sirainen obsolete(ctx, "imap_client_workarounds=netscape-eoh is no longer supported");
d461a91e5eb2270e77f4276f0268ba1eede6a08dTimo Sirainen config_parser_apply_line(ctx, CONFIG_LINE_TYPE_KEYVALUE,
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen strcmp(key, "mail_log_max_lines_per_sec") == 0 ||
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen strcmp(key, "maildir_copy_preserve_filename") == 0) {
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen config_parser_apply_line(ctx, CONFIG_LINE_TYPE_KEYVALUE,
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainenconfig_apply_login_set(struct config_parser_context *ctx,
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen const char *old_key, const char *key, const char *value)
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen obsolete(ctx, "%s has been replaced by service { %s }", old_key, key);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen if (config_filter_match(&old_section->filter, &imap_filter)) {
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen t_strdup_printf("service/imap-login/%s=%s", key, value), NULL);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen if (config_filter_match(&old_section->filter, &pop3_filter)) {
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen t_strdup_printf("service/pop3-login/%s=%s", key, value), NULL);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen if (config_filter_match(&old_section->filter, &managesieve_filter)) {
358f356749078ed2ae69fc48ced375761c877b61Timo Sirainen /* if pigeonhole isn't installed, this fails.
358f356749078ed2ae69fc48ced375761c877b61Timo Sirainen just ignore it then.. */
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen t_strdup_printf("service/managesieve-login/%s=%s", key, value), NULL);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainenconfig_apply_mail_set(struct config_parser_context *ctx,
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen const char *old_key, const char *key, const char *value)
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen obsolete(ctx, "%s has been replaced by service { %s }", old_key, key);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen if (config_filter_match(&old_section->filter, &imap_filter)) {
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen t_strdup_printf("service/imap/%s=%s", key,value), NULL);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen if (config_filter_match(&old_section->filter, &pop3_filter)) {
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen t_strdup_printf("service/pop3/%s=%s", key,value), NULL);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen if (config_filter_match(&old_section->filter, &managesieve_filter)) {
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen t_strdup_printf("service/managesieve/%s=%s", key,value), NULL);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainenconfig_apply_auth_set(struct config_parser_context *ctx,
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen const char *old_key, const char *key, const char *value)
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen obsolete(ctx, "%s has been replaced by service auth { %s }", old_key, key);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen t_strdup_printf("service/auth/%s=%s", key,value), NULL);
8bb360f9e5de1c25e4f875205bb06e8bf15dae14Timo Sirainen const char *const *addrs;
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainenold_settings_handle_proto(struct config_parser_context *ctx,
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen struct config_section_stack *old_section = ctx->cur_section;
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen const char *p;
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen root = config_filter_match(&old_section->filter, &any_filter);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen const char *ssl = strcmp(key, "ssl_listen") == 0 ? "s" : "";
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen /* default */
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen obsolete(ctx, "%s=..:port has been replaced by service { inet_listener { port } }", key);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen if (config_filter_match(&old_section->filter, &imap_filter)) {
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen t_strdup_printf("service/imap-login/inet_listener/imap%s/port=%s", ssl, p), NULL);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen if (config_filter_match(&old_section->filter, &pop3_filter)) {
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen t_strdup_printf("service/pop3-login/inet_listener/pop3%s/port=%s", ssl, p), NULL);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen config_filter_match(&old_section->filter, &managesieve_filter)) {
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen t_strdup_printf("service/managesieve-login/inet_listener/managesieve/port=%s", p), NULL);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen config_parser_apply_line(ctx, CONFIG_LINE_TYPE_KEYVALUE,
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen obsolete(ctx, "protocol { %s } has been replaced by service { inet_listener { address } }", key);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen if (config_filter_match(&old_section->filter, &imap_filter)) {
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen t_strdup_printf("service/imap-login/inet_listener/imap%s/address=%s", ssl, value), NULL);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen if (config_filter_match(&old_section->filter, &pop3_filter)) {
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen t_strdup_printf("service/pop3-login/inet_listener/pop3%s/address=%s", ssl, value), NULL);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen config_filter_match(&old_section->filter, &managesieve_filter)) {
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen t_strdup_printf("service/managesieve-login/inet_listener/managesieve/address=%s", value), NULL);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen config_apply_login_set(ctx, old_section, key, "chroot", value);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen config_apply_login_set(ctx, old_section, key, "user", value);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen config_apply_login_set(ctx, old_section, key, "executable", value);
a37c2c1ad645b6d8ea73e6d38695efdde4f3f928Timo Sirainen config_apply_login_set(ctx, old_section, key, "vsz_limit",
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen if (strcmp(key, "login_process_per_connection") == 0) {
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen config_apply_login_set(ctx, old_section, key, "service_count",
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen if (strcmp(key, "login_processes_count") == 0) {
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen config_apply_login_set(ctx, old_section, key, "process_min_avail", value);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen if (strcmp(key, "login_max_processes_count") == 0) {
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen config_apply_login_set(ctx, old_section, key, "process_limit", value);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen if (strcmp(key, "login_max_connections") == 0) {
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen config_apply_login_set(ctx, old_section, key, "client_limit", value);
a37c2c1ad645b6d8ea73e6d38695efdde4f3f928Timo Sirainen config_apply_login_set(ctx, old_section, key, "vsz_limit",
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen config_apply_mail_set(ctx, old_section, key, "process_limit", value);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen config_apply_mail_set(ctx, old_section, key, "executable", value);
a37c2c1ad645b6d8ea73e6d38695efdde4f3f928Timo Sirainen config_apply_mail_set(ctx, old_section, key, "vsz_limit",
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen if (strcmp(key, "mail_drop_priv_before_exec") == 0) {
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen config_apply_mail_set(ctx, old_section, key, "drop_priv_before_exec", value);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen config_apply_auth_set(ctx, key, "executable", value);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen config_apply_auth_set(ctx, key, "user", value);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen config_apply_auth_set(ctx, key, "chroot", value);
6bd263caf006edc75205f446fa0283c6f364941bTimo Sirainen str_to_uoff(value, &size) == 0 && size > 0 && size < 1024) {
5ce40a7370a19a98caeca5d2e27b3d6c77c90ea9Timo Sirainen obsolete(ctx, "auth_cache_size value no longer defaults to "
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen obsolete(ctx, "auth_count has been removed, and its value must be 1");
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen const char **p = NULL;
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainenstatic bool old_auth_section(struct config_parser_context *ctx,
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen if (ctx->old->auth_section == 0 && ctx->old->seen_auth_section) {
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen obsolete(ctx, "Multiple auth sections are no longer supported");
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen memset(&ctx->old->socket_set, 0, sizeof(ctx->old->socket_set));
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen if ((strcmp(key, "passdb") == 0 || strcmp(key, "userdb") == 0) &&
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen obsolete(ctx, "%s %s {} has been replaced by %s { driver=%s }",
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen config_parser_apply_line(ctx, CONFIG_LINE_TYPE_SECTION_BEGIN, key, "");
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen config_parser_apply_line(ctx, CONFIG_LINE_TYPE_KEYVALUE,
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen if (strcmp(key, "socket") == 0 && ctx->old->auth_section == 2) {
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen obsolete(ctx, "socket connect {} is no longer supported, configure external auth server separately");
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen /* socket listen { .. } */
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen if ((strcmp(key, "master") == 0 || strcmp(key, "client") == 0) &&
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen ctx->old->socket_set.master = strcmp(key, "master") == 0;
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainenstatic void socket_apply(struct config_parser_context *ctx)
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen const struct socket_set *set = &ctx->old->socket_set;
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen ctx->error = "socket listen {} is missing path";
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen if (strncmp(path, ctx->old->base_dir, len) == 0 &&
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen ctx->error = "socket listen { master { path=.. } } must end with -master (or -userdb) suffix";
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen ctx->error = "socket listen { client { path=.. } } must end not with -master or -userdb suffix";
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen t_strdup_printf("service/auth/unix_listener=%s", settings_section_escape(path)), path);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen prefix = t_strdup_printf("service/auth/unix_listener/%s", settings_section_escape(path));
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen t_strdup_printf("%s/mode=%s", prefix, set->mode), NULL);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen t_strdup_printf("%s/user=%s", prefix, set->user), NULL);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen t_strdup_printf("%s/group=%s", prefix, set->group), NULL);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen memset(&ctx->old->socket_set, 0, sizeof(ctx->old->socket_set));
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainenbool old_settings_handle(struct config_parser_context *ctx,
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen ret = old_settings_handle_proto(ctx, key, value);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen return old_settings_handle_root(ctx, key, value);
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen else if (ctx->pathlen == 0 && strcmp(key, "auth") == 0) {
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen obsolete(ctx, "add auth_ prefix to all settings inside auth {} and remove the auth {} section completely");
cb06054f863550b766950fe2949b69b7047bcd81Timo Sirainen } else if (ctx->pathlen == 0 && strcmp(key, "protocol") == 0 &&
ec1823d289727d53fc74073e6cdda61d64fc0761Timo Sirainen obsolete(ctx, "protocol managesieve {} has been replaced by protocol sieve { }");
ec1823d289727d53fc74073e6cdda61d64fc0761Timo Sirainen config_parser_apply_line(ctx, CONFIG_LINE_TYPE_SECTION_BEGIN,
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainenvoid old_settings_init(struct config_parser_context *ctx)
b28a1c61a5d262fd16b46bebe47dbfb90ac9c5fcTimo Sirainen ctx->old = p_new(ctx->pool, struct old_set_parser, 1);