# Base directory where to store runtime data.
#base_dir = /var/run/dovecot/
-# Protocols we want to be serving: imap imaps pop3 pop3s
-# If you only want to use dovecot-auth, you can set this to "none".
-#protocols = imap imaps
+# Protocols we want to be serving.
+#protocols = imap pop3 lmtp
# Disable LOGIN command and all other plaintext authentications unless
# SSL/TLS is used (LOGINDISABLED capability). Note that if the remote IP
}
service imap-login {
+ protocol = imap
type = auth-source
executable = imap-login
auth_dest_service = imap
}
service imap {
+ protocol = imap
+
# This would write rawlogs into user's ~/dovecot.rawlog/, if it exists:
# executable = rawlog /usr/libexec/dovecot/imap
# <doc/wiki/Debugging/Rawlog>
}
service pop3-login {
+ protocol = pop3
type = auth-source
executable = pop3-login
auth_dest_service = pop3
}
service pop3 {
+ protocol = pop3
executable = pop3
}
service lmtp {
+ protocol = lmtp
executable = lmtp
unix_listener {
static struct setting_define service_setting_defines[] = {
DEF(SET_STR, name),
+ DEF(SET_STR, protocol),
DEF(SET_STR, type),
DEF(SET_STR, executable),
DEF(SET_STR, user),
MEMBER(master_set) NULL,
MEMBER(name) "",
+ MEMBER(protocol) "",
MEMBER(type) "",
MEMBER(executable) "",
MEMBER(user) "",
static struct setting_define master_setting_defines[] = {
DEF(SET_STR, base_dir),
DEF(SET_STR, libexec_dir),
+ DEF(SET_STR, protocols),
DEF(SET_UINT, default_process_limit),
DEF(SET_UINT, default_client_limit),
static struct master_settings master_default_settings = {
MEMBER(base_dir) PKG_RUNDIR,
MEMBER(libexec_dir) PKG_LIBEXECDIR,
+ MEMBER(protocols) "imap pop3 lmtp",
MEMBER(default_process_limit) 100,
MEMBER(default_client_limit) 1000,
static bool
master_settings_verify(void *_set, pool_t pool, const char **error_r)
{
- const struct master_settings *set = _set;
+ struct master_settings *set = _set;
struct service_settings *const *services;
unsigned int i, j, count;
fix_file_listener_paths(&services[i]->fifo_listeners,
pool, set->base_dir);
}
+ set->protocols_split = p_strsplit(pool, set->protocols, " ");
return TRUE;
}
/* </settings checks> */
struct master_settings *master_set;
const char *name;
+ const char *protocol;
const char *type;
const char *executable;
const char *user;
struct master_settings {
const char *base_dir;
const char *libexec_dir;
+ const char *protocols;
unsigned int default_process_limit;
unsigned int default_client_limit;
ARRAY_DEFINE(services, struct service_settings *);
ARRAY_DEFINE(auths, struct master_auth_settings *);
+ char **protocols_split;
};
extern struct setting_parser_info master_setting_parser_info;
return NULL;
}
+static bool service_want(struct service_settings *set)
+{
+ char *const *proto;
+
+ if (*set->protocol == '\0')
+ return TRUE;
+
+ for (proto = set->master_set->protocols_split; *proto != NULL; proto++) {
+ if (strcmp(*proto, set->protocol) == 0)
+ return TRUE;
+ }
+ return FALSE;
+}
+
int services_create(const struct master_settings *set,
const char *const *child_process_env,
struct service_list **services_r, const char **error_r)
p_array_init(&service_list->services, pool, count);
for (i = 0; i < count; i++) {
+ if (!service_want(service_settings[i]))
+ continue;
service = service_create(pool, service_settings[i],
service_list, &error);
if (service == NULL) {