old-set-parser.c revision 66fbbac231b0385273b11f9b4c43ad252330dea5
/* Copyright (c) 2009-2010 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "str.h"
#include "settings-parser.h"
#include "config-parser-private.h"
#include "old-set-parser.h"
struct socket_set {
bool master;
};
struct old_set_parser {
const char *base_dir;
/* 1 when in auth {} section, >1 when inside auth { .. { .. } } */
unsigned int auth_section;
/* 1 when in socket listen {}, >1 when inside more of its sections */
unsigned int socket_listen_section;
bool seen_auth_section;
struct socket_set socket_set;
};
static const struct config_filter any_filter = {
};
static const struct config_filter imap_filter = {
.service = "imap"
};
static const struct config_filter pop3_filter = {
.service = "pop3"
};
static const struct config_filter managesieve_filter = {
.service = "sieve"
};
{
static bool seen_obsoletes = FALSE;
if (!seen_obsoletes) {
i_warning("NOTE: You can get a new clean config file with: "
"doveconf -n > dovecot-new.conf");
}
i_warning("Obsolete setting in %s:%u: %s",
}
{
}
static bool
{
const char *p;
unsigned int len;
}
char **protos, **s;
if (strcmp(*s, "imap") == 0)
else if (strcmp(*s, "imaps") == 0) {
*s = "";
have_imaps = TRUE;
} else if (strcmp(*s, "pop3") == 0)
else if (strcmp(*s, "pop3s") == 0) {
*s = "";
have_pop3s = TRUE;
} else if (strcmp(*s, "managesieve") == 0) {
*s = "sieve";
}
}
/* ugly way to drop extra spaces.. */
if (have_imaps && !have_imap) {
obsolete(ctx, "protocols=imaps is no longer supported. to disable non-ssl imap, use service imap-login { inet_listener imap { port=0 } }");
"service/imap-login/inet_listener/imap/port=0", NULL);
} else if (have_imaps)
if (have_pop3s && !have_pop3) {
obsolete(ctx, "protocols=pop3s is no longer supported. to disable non-ssl pop3, use service pop3-login { inet_listener pop3 { port=0 } }");
"service/pop3-login/inet_listener/pop3/port=0", NULL);
} else if (have_pop3s)
return TRUE;
}
if (*value == '\0')
return TRUE;
p, value);
return TRUE;
}
value = "no";
value = "yes";
return TRUE;
}
value = "never";
value = "optimized";
return TRUE;
}
return TRUE;
}
*arg = "";
*arg = "";
}
}
return TRUE;
}
return TRUE;
}
return TRUE;
}
return FALSE;
}
static void
struct config_section_stack *old_section,
{
}
}
/* if pigeonhole isn't installed, this fails.
just ignore it then.. */
}
}
static void
struct config_section_stack *old_section,
{
}
}
}
}
static void
{
}
static bool listen_has_port(const char *str)
{
const char *const *addrs;
return FALSE;
!is_ipv4_address(*addrs) &&
!is_ipv6_address(*addrs))
return TRUE;
}
return FALSE;
}
static bool
{
const char *p;
bool root;
if (*value == '\0') {
/* default */
return TRUE;
}
if (p != NULL) {
}
}
if (*ssl == '\0' &&
}
}
} else {
}
}
if (*ssl == '\0' &&
}
}
return TRUE;
}
value = "";
else
value = "login";
return TRUE;
}
return TRUE;
}
return TRUE;
}
return TRUE;
}
return TRUE;
}
return TRUE;
}
return TRUE;
}
return TRUE;
}
return TRUE;
}
return TRUE;
}
return TRUE;
}
return TRUE;
}
return TRUE;
}
}
return TRUE;
}
return TRUE;
}
return TRUE;
}
return TRUE;
}
else
return TRUE;
}
const char **p = NULL;
if (p != NULL) {
return TRUE;
}
}
return FALSE;
}
{
return FALSE;
}
"driver", value);
return TRUE;
}
obsolete(ctx, "socket connect {} is no longer supported, configure external auth server separately");
return FALSE;
}
return FALSE;
/* socket listen { .. } */
return TRUE;
}
return TRUE;
}
return FALSE;
}
const char *value)
{
return FALSE;
"type", value);
return TRUE;
}
{
unsigned int len;
bool master_suffix;
return;
}
return;
return;
}
}
}
}
}
enum config_line_type type,
{
switch (type) {
case CONFIG_LINE_TYPE_SKIP:
case CONFIG_LINE_TYPE_ERROR:
case CONFIG_LINE_TYPE_INCLUDE:
case CONFIG_LINE_TYPE_KEYFILE:
break;
struct config_section_stack *old_section =
bool ret;
if (ret)
return TRUE;
}
break;
obsolete(ctx, "add auth_ prefix to all settings inside auth {} and remove the auth {} section completely");
return TRUE;
"protocol", "sieve");
return TRUE;
}
break;
return TRUE;
}
return TRUE;
}
break;
}
return FALSE;
}
{
}