For additional modules, the mail_plugin_dir parameter is ignored
Hi.
The
NixOS
distribution
for
Dovecot
uses
a
patch
that
hardcodes
the
path
to
the
plugins
in
/etc/dovecot/modules
.
The
modules
themselves
are
located
at
/nix/store/z9kf4ri8sq9f3r510qsm59g1n6kfc7q6-dovecot-2.3.21.1/lib/dovecot
,
the
script
creates
symlinks
in
the
/etc/dovecot/modules
directory.
The
additional
modules
are
loaded
normally.
Now
I
want
to
remove
the
patch.
I
added
the
parameter
“--with-moduledir=$(out)/etc/dovecot/modules”
,
and
the
modules
are
located
at
path
/nix/store/wb885d6w5dfchg9v481f55zj4a2p3r89-dovecot-2.3.21.1/etc/dovecot/modules
.
In
the
configuration
I
added
the
parameter
`mail_plugin_dir
/etc/dovecot/modules`. The main modules load fine, but the optional modules don't want to load:
Error:
Plugin
'imap_sieve'
not
found
from
directory
/nix/store/wb885d6w5dfchg9v481f55zj4a2p3r89-dovecot-2.3.21.1/etc/dovecot/modules
For additional modules, the mail_plugin_dir parameter is ignored.
Temporary solution
in src/config/config-parser.h file I replaced the line
#define
CONFIG_MODULE_DIR
MODULEDIR"/settings”
by
#define
CONFIG_MODULE_DIR
“/etc/dovecot/modules/settings”
-- Best regards, Lafiel mailto:lafiel@elven.pw
Hi.
The NixOS distribution for Dovecot uses a patch that hardcodes the path to the...
I am bit confused, do you want moduledir to be /etc/dovecot/modules or /nix/store/.../etc/dovecot/modules?
The error you are getting means the module isn't in that directory, or cannot find it's dependencies.
Also why put modules into /etc?
Aki
Hi, Aki Tuomi.
I want all modules to be loaded from /etc/dovecot/modules. The thing is that if I specify loading modules from /nix/store/wb885d6w5dfchg9v481f55zj4a2p3r89-dovecot-2.3.21.1/etc/dovecot/modules directory, it will fail to load the sieve module, which is located at /nix/store/a2nk4xa66qfv1x2vhils0npwyyyasv4b7-dovecot-pigeonhole-0.5.21.1/etc/dovecot/modules directory.
That's why NixOS came up with a workaround
they put symlinks to the core and extended modules in the /etc/dovecot/modules directory.
Now it is necessary to patch the file src/config/config-parser.h to specify where to load additional files from. I would like to get rid of patches completely and use the configuration file to specify where to load additional modules from.
PR in NixOS: https://github.com/NixOS/nixpkgs/pull/387642
Sorry, I still haven't figured out which email and address to write to so I don't break the email chain in mailman.
Aki Tuomi via dovecot писал(а) 2025-03-07 10:44:
I am bit confused, do you want moduledir to be /etc/dovecot/modules or /nix/store/.../etc/dovecot/modules?
The error you are getting means the module isn't in that directory, or cannot find it's dependencies.
Also why put modules into /etc?
Aki
dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
-- Best regards, Lafiel mailto:lafiel@elven.pw
Hi, Aki Tuomi.
Is it possible to fix loading of additional modules specified in mail_plugin_dir parameter?
-- Best regards, Lafiel mailto:lafiel@elven.pw
On 31/03/2025 07:57 EEST Lafiel via dovecot <dovecot@dovecot.org> wrote:
Hi, Aki Tuomi.
Is it possible to fix loading of additional modules specified in mail_plugin_dir parameter?
-- Best regards, Lafiel mailto:lafiel@elven.pw
Have you tried --with-moduledir=/etc/dovecot/modules when doing ./configure and use make DESTDIR=/nix/store/foobar to install things elsewhere.
Aki
Hi, Aki Tuomi.
With this configurations: --with-moduledir=/nix/store/fgjwcnzz4ll6jjah8mpzfxpc4asa600q-dovecot-2.3.21/etc/dovecot/modules DESTDIR=/nix/store/fgjwcnzz4ll6jjah8mpzfxpc4asa600q-dovecot-2.3.21 mail_plugin_dir=/nix/store/fgjwcnzz4ll6jjah8mpzfxpc4asa600q-dovecot-2.3.21/etc/dovecot/modules
Error: doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf: protocols: Unknown protocol: sieve
This was only variant that worked. Need change option mail_plugin_dir (created symbolic links): mail_plugin_dir = /etc/dovecot/modules
and replace in file src/config/config-parser.h to: #define CONFIG_MODULE_DIR "/etc/dovecot/modules/settings"
I need to avoid hard linking to the /etc/dovecot/modules path and applying a patch to source code. For example, specify in configuration mail_plugin_dir=/nix/store/.../lib/dovecot/modules, which contains all the necessary plugins by creating symbolic links. The problem is that the src/config/config-parser.h file ignores the mail_plugin_dir parameter, which is used to load additional dovecot modules.
Aki Tuomi via dovecot писал(а) 2025-03-31 08:44:
Have you tried --with-moduledir=/etc/dovecot/modules when doing ./configure and use make DESTDIR=/nix/store/foobar to install things elsewhere.
Aki
-- Best regards, Lafiel mailto:lafiel@elven.pw
participants (2)
-
Aki Tuomi
-
Lafiel