all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Efraim Flashner <efraim@flashner.co.il>
To: Alexey Abramov <levenson@mmer.org>
Cc: 42899@debbugs.gnu.org
Subject: [bug#42899] [PATCH v2 02/10] gnu: dovecot: Patch and provide a static path for module directory.
Date: Wed, 19 Aug 2020 10:41:32 +0300	[thread overview]
Message-ID: <20200819074132.GE10528@E5400> (raw)
In-Reply-To: <20200818120037.30722-2-levenson@mmer.org>

[-- Attachment #1: Type: text/plain, Size: 8731 bytes --]

How are all the XXX_MODULE_DIR variables set? Would it be possible to
just set MODULE_DIR to /etc/dovecot/modules and leave the others as-is?
They seem to just use a file/folder under MODULE_DIR.

On Tue, Aug 18, 2020 at 02:00:30PM +0200, Alexey Abramov wrote:
> * gnu/local.mk (dist_patch_DATA): Add it.
> * gnu/packages/patches/dovecot-use-static-path-for-moduledir.patch: New file.
> * gnu/packages/mail.scm (dovecot)[source]: Use it.
> 
> Signed-off-by: Alexey Abramov <levenson@mmer.org>
> ---
>  gnu/local.mk                                  |   1 +
>  gnu/packages/mail.scm                         |   3 +-
>  ...ovecot-use-static-path-for-moduledir.patch | 146 ++++++++++++++++++
>  3 files changed, 149 insertions(+), 1 deletion(-)
>  create mode 100644 gnu/packages/patches/dovecot-use-static-path-for-moduledir.patch
> 
> diff --git a/gnu/local.mk b/gnu/local.mk
> index 87bd7094bf..2817deb01f 100644
> --- a/gnu/local.mk
> +++ b/gnu/local.mk
> @@ -900,6 +900,7 @@ dist_patch_DATA =						\
>    %D%/packages/patches/doc++-include-directives.patch		\
>    %D%/packages/patches/doc++-segfault-fix.patch			\
>    %D%/packages/patches/docker-fix-tests.patch			\
> +  %D%/packages/patches/dovecot-use-static-path-for-moduledir.patch	\
>    %D%/packages/patches/dovecot-trees-support-dovecot-2.3.patch	\
>    %D%/packages/patches/doxygen-test.patch			\
>    %D%/packages/patches/doxygen-1.8.17-runtests.patch		\
> diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
> index 98e75fa90f..8e7d5b2fc1 100644
> --- a/gnu/packages/mail.scm
> +++ b/gnu/packages/mail.scm
> @@ -1411,7 +1411,8 @@ facilities for checking incoming mail.")
>                             (version-major+minor version) "/"
>                             "dovecot-" version ".tar.gz"))
>         (sha256
> -        (base32 "1p5gp8jbavcsaara5mfn5cbrnlxssajnchczbgmmfzr7228fmnfk"))))
> +        (base32 "1p5gp8jbavcsaara5mfn5cbrnlxssajnchczbgmmfzr7228fmnfk"))
> +       (patches (search-patches "dovecot-use-static-path-for-moduledir.patch"))))
>      (build-system gnu-build-system)
>      (native-inputs
>       `(("pkg-config" ,pkg-config)))
> diff --git a/gnu/packages/patches/dovecot-use-static-path-for-moduledir.patch b/gnu/packages/patches/dovecot-use-static-path-for-moduledir.patch
> new file mode 100644
> index 0000000000..da9f4034f4
> --- /dev/null
> +++ b/gnu/packages/patches/dovecot-use-static-path-for-moduledir.patch
> @@ -0,0 +1,146 @@
> +Subject: [PATCH] Use static path for moduledir.
> +
> +Patch was taken from NixOS repo. Make dovecot look for plugins in
> +/etc/dovecot/modules so we can symlink plugins from several packages
> +there.
> +
> +The rational behind the patch can be found here:
> +https://dovecot.org/pipermail/dovecot/2013-April/089931.html
> +
> +---
> + src/auth/main.c                         | 4 ++--
> + src/config/config-parser.c              | 2 +-
> + src/config/config-parser.h              | 2 +-
> + src/dict/main.c                         | 2 +-
> + src/doveadm/doveadm-util.c              | 4 ++--
> + src/lib-fs/fs-api.c                     | 2 +-
> + src/lib-ssl-iostream/iostream-ssl.c     | 4 ++--
> + src/lib-storage/mail-storage-settings.c | 2 +-
> + 9 files changed, 12 insertions(+), 12 deletions(-)
> +
> +diff --git a/src/auth/main.c b/src/auth/main.c
> +index 2dbf9e176..b1e778ab7 100644
> +--- a/src/auth/main.c
> ++++ b/src/auth/main.c
> +@@ -192,7 +192,7 @@ static void main_preinit(void)
> + 	mod_set.debug = global_auth_settings->debug;
> + 	mod_set.filter_callback = auth_module_filter;
> +
> +-	modules = module_dir_load(AUTH_MODULE_DIR, NULL, &mod_set);
> ++	modules = module_dir_load("/etc/dovecot/modules/auth", NULL, &mod_set);
> + 	module_dir_init(modules);
> +
> + 	if (!worker)
> +@@ -223,7 +223,7 @@ void auth_module_load(const char *names)
> + 	mod_set.debug = global_auth_settings->debug;
> + 	mod_set.ignore_missing = TRUE;
> +
> +-	modules = module_dir_load_missing(modules, AUTH_MODULE_DIR, names,
> ++	modules = module_dir_load_missing(modules, "/etc/dovecot/modules/auth", names,
> + 					  &mod_set);
> + 	module_dir_init(modules);
> + }
> +diff --git a/src/config/config-parser.c b/src/config/config-parser.c
> +index 6894123ea..07e9fecb4 100644
> +--- a/src/config/config-parser.c
> ++++ b/src/config/config-parser.c
> +@@ -1077,7 +1077,7 @@ void config_parse_load_modules(void)
> +
> + 	i_zero(&mod_set);
> + 	mod_set.abi_version = DOVECOT_ABI_VERSION;
> +-	modules = module_dir_load(CONFIG_MODULE_DIR, NULL, &mod_set);
> ++	modules = module_dir_load("/etc/dovecot/modules/settings", NULL, &mod_set);
> + 	module_dir_init(modules);
> +
> + 	i_array_init(&new_roots, 64);
> +diff --git a/src/config/config-parser.h b/src/config/config-parser.h
> +index e0a0a5bea..32bd76804 100644
> +--- a/src/config/config-parser.h
> ++++ b/src/config/config-parser.h
> +@@ -1,7 +1,7 @@
> + #ifndef CONFIG_PARSER_H
> + #define CONFIG_PARSER_H
> +
> +-#define CONFIG_MODULE_DIR MODULEDIR"/settings"
> ++#define CONFIG_MODULE_DIR "/etc/dovecot/modules/settings"
> +
> + #define IS_WHITE(c) ((c) == ' ' || (c) == '\t')
> +
> +diff --git a/src/dict/main.c b/src/dict/main.c
> +index 722ed025f..4ed12ae5e 100644
> +--- a/src/dict/main.c
> ++++ b/src/dict/main.c
> +@@ -104,7 +104,7 @@ static void main_init(void)
> + 	mod_set.abi_version = DOVECOT_ABI_VERSION;
> + 	mod_set.require_init_funcs = TRUE;
> +
> +-	modules = module_dir_load(DICT_MODULE_DIR, NULL, &mod_set);
> ++	modules = module_dir_load("/etc/dovecot/modules/dict", NULL, &mod_set);
> + 	module_dir_init(modules);
> +
> + 	/* Register only after loading modules. They may contain SQL drivers,
> +diff --git a/src/doveadm/doveadm-util.c b/src/doveadm/doveadm-util.c
> +index a65ef7f72..c19eba06c 100644
> +--- a/src/doveadm/doveadm-util.c
> ++++ b/src/doveadm/doveadm-util.c
> +@@ -33,7 +33,7 @@ void doveadm_load_modules(void)
> + 	mod_set.debug = doveadm_debug;
> + 	mod_set.ignore_dlopen_errors = TRUE;
> +
> +-	modules = module_dir_load_missing(modules, DOVEADM_MODULEDIR,
> ++	modules = module_dir_load_missing(modules, "/etc/dovecot/modules/doveadm",
> + 					  NULL, &mod_set);
> + 	module_dir_init(modules);
> + }
> +@@ -58,7 +58,7 @@ bool doveadm_has_unloaded_plugin(const char *name)
> + 			return FALSE;
> + 	}
> +
> +-	dir = opendir(DOVEADM_MODULEDIR);
> ++	dir = opendir("/etc/dovecot/modules/doveadm");
> + 	if (dir == NULL)
> + 		return FALSE;
> +
> +diff --git a/src/lib-fs/fs-api.c b/src/lib-fs/fs-api.c
> +index a939f612d..846cf86e6 100644
> +--- a/src/lib-fs/fs-api.c
> ++++ b/src/lib-fs/fs-api.c
> +@@ -114,7 +114,7 @@ static void fs_class_try_load_plugin(const char *driver)
> + 	mod_set.abi_version = DOVECOT_ABI_VERSION;
> + 	mod_set.ignore_missing = TRUE;
> +
> +-	fs_modules = module_dir_load_missing(fs_modules, MODULE_DIR,
> ++	fs_modules = module_dir_load_missing(fs_modules, "/etc/dovecot/modules",
> + 					     module_name, &mod_set);
> + 	module_dir_init(fs_modules);
> +
> +diff --git a/src/lib-ssl-iostream/iostream-ssl.c b/src/lib-ssl-iostream/iostream-ssl.c
> +index f62c80d37..900ab46c4 100644
> +--- a/src/lib-ssl-iostream/iostream-ssl.c
> ++++ b/src/lib-ssl-iostream/iostream-ssl.c
> +@@ -54,8 +54,8 @@ int ssl_module_load(const char **error_r)
> + 	mod_set.abi_version = DOVECOT_ABI_VERSION;
> + 	mod_set.setting_name = "<built-in lib-ssl-iostream lookup>";
> + 	mod_set.require_init_funcs = TRUE;
> +-	ssl_module = module_dir_load(MODULE_DIR, plugin_name, &mod_set);
> +-	if (module_dir_try_load_missing(&ssl_module, MODULE_DIR, plugin_name,
> ++	ssl_module = module_dir_load("/etc/dovecot/modules", plugin_name, &mod_set);
> ++	if (module_dir_try_load_missing(&ssl_module, "/etc/dovecot/modules", plugin_name,
> + 					&mod_set, error_r) < 0)
> + 		return -1;
> + 	module_dir_init(ssl_module);
> +diff --git a/src/lib-storage/mail-storage-settings.c b/src/lib-storage/mail-storage-settings.c
> +index b314b529c..705509456 100644
> +--- a/src/lib-storage/mail-storage-settings.c
> ++++ b/src/lib-storage/mail-storage-settings.c
> +@@ -337,7 +337,7 @@ static const struct mail_user_settings mail_user_default_settings = {
> + 	.last_valid_gid = 0,
> +
> + 	.mail_plugins = "",
> +-	.mail_plugin_dir = MODULEDIR,
> ++	.mail_plugin_dir = "/etc/dovecot/modules",
> +
> + 	.mail_log_prefix = "%s(%u)<%{pid}><%{session}>: ",
> +
> +--
> +2.27.0
> -- 
> 2.27.0
> 
> 
> 
> 

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-08-19  7:43 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-17  9:27 [bug#42899] [PATCH 00/10] Dovecot improvements. Add support for pigeonhole Alexey Abramov
2020-08-17  9:31 ` [bug#42899] [PATCH 01/10] gnu: dovecot: Add lucene library to support fts indexing Alexey Abramov
2020-08-17  9:31   ` [bug#42899] [PATCH 02/10] gnu: dovecot: Patch and provide a static path for module directory Alexey Abramov
2020-08-17  9:31   ` [bug#42899] [PATCH 03/10] services: dovecot: Use modules via symlink to system profile Alexey Abramov
2020-08-17  9:31   ` [bug#42899] [PATCH 04/10] gnu: dovecot-pigeonhole: Add new variable Alexey Abramov
2020-08-26  4:23     ` Tobias Geerinckx-Rice via Guix-patches via
2020-08-17  9:31   ` [bug#42899] [PATCH 05/10] services: dovecot: Serialize global settings first Alexey Abramov
2020-08-17  9:31   ` [bug#42899] [PATCH 06/10] services: dovecot: Only serialize settings with non-empty values Alexey Abramov
2020-08-17  9:31   ` [bug#42899] [PATCH 07/10] services: dovecot: Add 'mail-attribute-dict' configuration option Alexey Abramov
2020-08-17  9:31   ` [bug#42899] [PATCH 08/10] services: dovecot: Add 'imap-metadata?' protocol " Alexey Abramov
2020-08-17  9:31   ` [bug#42899] [PATCH 09/10] services: dovecot: Add 'managesieve-notify-capability' configuration Alexey Abramov
2020-08-17  9:31   ` [bug#42899] [PATCH 10/10] services: dovecot: Add 'managesieve-sieve-capability' option Alexey Abramov
2020-08-18 12:00 ` [bug#42899] [PATCH v2 01/10] gnu: dovecot: Add lucene library to support fts indexing Alexey Abramov
2020-08-18 12:00   ` [bug#42899] [PATCH v2 02/10] gnu: dovecot: Patch and provide a static path for module directory Alexey Abramov
2020-08-19  7:41     ` Efraim Flashner [this message]
2020-08-19  9:44       ` Alexey Abramov
2020-08-23 20:45         ` Efraim Flashner
2020-08-24 10:01           ` Alexey Abramov
2020-08-18 12:00   ` [bug#42899] [PATCH v2 03/10] services: dovecot: Use modules via symlink to system profile Alexey Abramov
2020-08-18 12:00   ` [bug#42899] [PATCH v2 04/10] gnu: dovecot-pigeonhole: Add new variable Alexey Abramov
2020-08-23 21:16     ` Efraim Flashner
2020-08-24 10:47       ` Alexey Abramov
2020-08-18 12:00   ` [bug#42899] [PATCH v2 05/10] services: dovecot: Serialize global settings first Alexey Abramov
2020-08-18 12:00   ` [bug#42899] [PATCH v2 06/10] services: dovecot: Only serialize settings with non-empty values Alexey Abramov
2020-08-18 12:00   ` [bug#42899] [PATCH v2 07/10] services: dovecot: Add 'mail-attribute-dict' configuration option Alexey Abramov
2020-08-18 12:00   ` [bug#42899] [PATCH v2 08/10] services: dovecot: Add 'imap-metadata?' protocol " Alexey Abramov
2020-08-18 12:00   ` [bug#42899] [PATCH v2 09/10] services: dovecot: Add 'managesieve-notify-capability' option Alexey Abramov
2020-08-23 21:18   ` [bug#42899] [PATCH v2 01/10] gnu: dovecot: Add lucene library to support fts indexing Efraim Flashner
2020-08-23 21:23 ` [bug#42899] [PATCH 00/10] Dovecot improvements. Add support for pigeonhole Efraim Flashner
2020-08-27 15:17 ` [bug#42899] [PATCH v3 1/9] gnu: dovecot: Set moduledir to global directory Alexey Abramov
2020-08-27 15:17   ` [bug#42899] [PATCH v3 2/9] services: dovecot: Use modules via symlink to system profile Alexey Abramov
2020-08-27 15:17   ` [bug#42899] [PATCH v3 3/9] gnu: dovecot-pigeonhole: Add new variable Alexey Abramov
2020-08-27 15:17   ` [bug#42899] [PATCH v3 4/9] services: dovecot: Serialize global settings first Alexey Abramov
2020-08-27 15:17   ` [bug#42899] [PATCH v3 5/9] services: dovecot: Only serialize settings with non-empty values Alexey Abramov
2020-08-27 15:17   ` [bug#42899] [PATCH v3 6/9] services: dovecot: Add 'mail-attribute-dict' configuration option Alexey Abramov
2020-08-27 15:17   ` [bug#42899] [PATCH v3 7/9] services: dovecot: Add 'imap-metadata?' protocol " Alexey Abramov
2020-08-27 15:17   ` [bug#42899] [PATCH v3 8/9] services: dovecot: Add 'managesieve-notify-capability' option Alexey Abramov
2020-08-27 15:17   ` [bug#42899] [PATCH v3 9/9] services: dovecot: Add 'managesieve-sieve-capability' option Alexey Abramov
2020-09-08 13:53 ` [bug#42899] [PATCH v4 1/8] gnu: dovecot: Set moduledir to global directory Alexey Abramov
2020-09-08 13:53   ` [bug#42899] [PATCH v4 2/8] services: dovecot: Use modules via symlink to system profile Alexey Abramov
2020-09-08 13:53   ` [bug#42899] [PATCH v4 3/8] services: dovecot: Serialize global settings first Alexey Abramov
2020-09-08 13:53   ` [bug#42899] [PATCH v4 4/8] services: dovecot: Only serialize settings with non-empty values Alexey Abramov
2020-09-08 13:53   ` [bug#42899] [PATCH v4 5/8] services: dovecot: Add 'mail-attribute-dict' configuration option Alexey Abramov
2020-09-08 13:53   ` [bug#42899] [PATCH v4 6/8] services: dovecot: Add 'imap-metadata?' protocol " Alexey Abramov
2020-09-08 13:53   ` [bug#42899] [PATCH v4 7/8] services: dovecot: Add 'managesieve-notify-capability' option Alexey Abramov
2020-09-08 13:53   ` [bug#42899] [PATCH v4 8/8] services: dovecot: Add 'managesieve-sieve-capability' option Alexey Abramov
2020-09-08 14:03   ` [bug#42899] [PATCH v4 1/8] gnu: dovecot: Set moduledir to global directory Tobias Geerinckx-Rice via Guix-patches via
2020-09-08 14:21     ` Alexey Abramov
2020-10-20 15:06 ` [bug#42899] [PATCH v5 0/6] Dovecot improvements Alexey Abramov
2020-10-20 15:06   ` [bug#42899] [PATCH v5 1/6] gnu: dovecot: Set moduledir to global directory Alexey Abramov
2020-10-20 15:06   ` [bug#42899] [PATCH v5 2/6] services: dovecot: Provide plugins through a /gnu/store directory Alexey Abramov
2020-10-20 15:06   ` [bug#42899] [PATCH v5 3/6] services: dovecot: Add 'mail-attribute-dict' configuration option Alexey Abramov
2020-10-20 15:06   ` [bug#42899] [PATCH v5 4/6] services: dovecot: Add 'imap-metadata?' protocol " Alexey Abramov
2020-10-20 15:06   ` [bug#42899] [PATCH v5 5/6] services: dovecot: Add 'managesieve-notify-capability' option Alexey Abramov
2020-10-20 15:06   ` [bug#42899] [PATCH v5 6/6] services: dovecot: Add 'managesieve-sieve-capability' option Alexey Abramov
2020-12-25 16:15 ` [bug#42899] [PATCH 00/10] Dovecot improvements. Add support for pigeonhole Alexey Abramov via web
2024-07-16 21:37   ` Thomas Ieong
2024-11-21 12:25 ` [bug#42899] [PATCH v6 0/3] services: dovecot: Add pigeonhole support Alexey Abramov via Guix-patches via
2024-11-21 12:25   ` [bug#42899] [PATCH v6 1/3] gnu: dovecot: Set moduledir to global directory Alexey Abramov via Guix-patches via
2024-11-21 12:25   ` [bug#42899] [PATCH v6 2/3] services: dovecot: Provide plugins through a /gnu/store directory Alexey Abramov via Guix-patches via
2024-11-21 12:25   ` [bug#42899] [PATCH v6 3/3] tests: dovecot: Add sieve Alexey Abramov via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200819074132.GE10528@E5400 \
    --to=efraim@flashner.co.il \
    --cc=42899@debbugs.gnu.org \
    --cc=levenson@mmer.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.