Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/plugins/welcome/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ module_LTLIBRARIES = \
lib99_welcome_plugin.la

lib99_welcome_plugin_la_SOURCES = \
welcome-plugin.c
welcome-plugin.c \
welcome-settings.c
7 changes: 7 additions & 0 deletions src/plugins/welcome/welcome-plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "module-context.h"
#include "settings.h"
#include "settings-parser.h"
#include "service-settings.h"
#include "mail-storage-private.h"

#define WELCOME_CONTEXT(obj) \
Expand Down Expand Up @@ -151,8 +152,13 @@ static struct mail_storage_hooks welcome_mail_storage_hooks = {
void welcome_plugin_init(struct module *module);
void welcome_plugin_deinit(void);

extern struct service_settings welcome_service_settings;
extern const struct setting_keyvalue welcome_service_settings_defaults[];

void welcome_plugin_init(struct module *module)
{
service_settings_register(&welcome_service_settings,
welcome_service_settings_defaults);
mail_storage_hooks_add(module, &welcome_mail_storage_hooks);
}

Expand All @@ -167,6 +173,7 @@ void welcome_plugin_deinit(void)
}

mail_storage_hooks_remove(&welcome_mail_storage_hooks);
service_settings_unregister(&welcome_service_settings);
}

const char *welcome_plugin_version = DOVECOT_ABI_VERSION;
38 changes: 38 additions & 0 deletions src/plugins/welcome/welcome-settings.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/* Copyright (c) 2023 Dovecot authors, see the included COPYING file */

#include "lib.h"
#include "array.h"
#include "service-settings.h"

struct service_settings welcome_service_settings = {
.name = "welcome",
.protocol = "",
.type = "",
.executable = "",
.user = "$SET:default_internal_user",
.group = "",
.privileged_group = "",
.extra_groups = ARRAY_INIT,
.chroot = "",

.drop_priv_before_exec = FALSE,

.process_min_avail = 0,
.process_limit = 1,
.client_limit = 0,
.service_count = 0,
.idle_kill = 0,
.vsz_limit = UOFF_T_MAX,

.unix_listeners = ARRAY_INIT,
.fifo_listeners = ARRAY_INIT,
.inet_listeners = ARRAY_INIT,
};

const struct setting_keyvalue welcome_service_settings_defaults[] = {
{ "unix_listener", "welcome" },

{ "unix_listener/welcome/user", "vmail" },

{ NULL, NULL }
};