Open chkno opened 2 years ago
I'd need to take a look at the code and maybe ask upstream, but what solution do you propose?
How would withPackages
work for something like this? Would we need to patch dovecot to read plugin paths from environment variabes? I'm not sure that's better than the status quo, tbh.
Reading the plugin path from an environment valiable seems ok to me. It's strictly better than hardcoding /etc/dovecot/modules
:
FWIW this also breaks rootless setups. The server starts fine but any client will get disconnected immediately:
master: Info: Dovecot v2.3.20 (80a5ac675d) starting up for imap
imap-login: Error: imap-login(init): Fatal: opendir(/etc/dovecot/modules) failed: No such file or directory
master: Error: service(imap-login): command startup failed, throttling for 2.000 secs
imap-login: Fatal: master: service(imap-login): child 358212 returned error 89 (Fatal failure)
I don't have a good idea on how to fix that though.
The configure script has the --with-moduledir
option so the patch could be removed. I guess it would also make overlays a bit easier to work with (but maybe it's just me, I couldn't figure out how to filter out the patch without porting over the list).
EDIT: it's not as simple as that, too bad.
Describe the bug
Basic unprivileged dovecot utility functionality requires dovecot to be installed system-wide. This makes it impossible to use dovecot utilities without administrator privileges, and makes it impossible for multiple versions of dovecot to coexist on the same machine. These are core Nix competencies & it's surprising to find them lacking for this package.
Steps To Reproduce
On a machine without dovecot installed system-wide, try to generate a password hash:
Expected behavior
Additional context
This is caused by nixpkgs's own patch which modifies upstream's module-directory logic to force it to be in /etc. Just removing this patch makes things work again:
This was implemented in 2013 in 93ff42ae9c33b2f507c766ac5b2398cfd287ef30 as a way to allow combining dovecot modules from multiple derivations. Since 2013, nixpkgs has figured out much better ways to do this (eg: the various withPackages mechanisms). Dovecot's mechanism needs to be updated to these more recent, better practices.
Notify maintainers
Maintainers: @fpletz @globin @ajs124 Author of 93ff42ae9c33b2f507c766ac5b2398cfd287ef30: @rickynils