Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dovecot: add lua support #109551

Closed
wants to merge 1 commit into from
Closed

Conversation

ajs124
Copy link
Member

@ajs124 ajs124 commented Jan 16, 2021

Motivation for this change

A feature I want/need in my e-mail setup needs this.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@@ -17639,7 +17639,9 @@ in

dodgy = with python3Packages; toPythonApplication dodgy;

dovecot = callPackage ../servers/mail/dovecot { };
dovecot = callPackage ../servers/mail/dovecot {
lua = lua5_4;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not necessary, but it builds with it and our lua defaults to 5.2 for some reason, which has been EOL since 2015.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should update the default lua version.

"--with-icu"
"--with-lz4"
"--with-ssl=openssl"
"--with-zlib"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reordered these, because they were quite random and ldap was enabled twice.

@@ -12,13 +13,15 @@ stdenv.mkDerivation rec {
pname = "dovecot";
version = "2.3.13";

nativeBuildInputs = [ perl pkgconfig ];
# autoreconfHook can be removed as soon as the patch to fix the lua build below is removed
nativeBuildInputs = [ autoreconfHook perl pkgconfig ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
nativeBuildInputs = [ autoreconfHook perl pkgconfig ];
nativeBuildInputs = [ autoreconfHook perl pkg-config ];

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ajs124 @dasJ 👎🏼

, bzip2, zlib, lz4, inotify-tools, pam, libcap
, clucene_core_2, icu, openldap, libsodium, libstemmer, cyrus_sasl
, nixosTests
# Auth modules
, withLua ? true, lua, autoreconfHook
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if we want to enable it by default. Do you think this would be something everyone would need or more of a niche feature?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, this must be optional.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because closure size and security

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is dovecot. If you don't configure a lua userdb or passdb, this code will never run. Are you running this anywhere?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, dovecot is my imap server. But I see that you have commit access so I assume you're going to merge this anyway.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I won't, I've decided that I'm just going to deploy this in my own system and not bother.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that answering a simple question with a thumbs down is how we want to communicate here. If all other distros enable this by default then we can just enable it without any flag. If none of the distros enable it by default then we need to think about it a bit more. If it does not decrease security or increase closure size by that much we can also enable it by default and maybe add a flag to disable it. If it is a feature you definitely want to disable by default then a by default disabled flag is required.

I just think it is a good idea to maybe talk two sentences about such a flag in a program like dovecot which might impact a lot of people before adding a default enabled flag which might or might not cause a big change for all of them. If we can't do that then I don't think I work as a reviewer for your PRs.

Copy link
Member

@hmenke hmenke Jan 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debian splits Lua authentication into an extra package (https://packages.debian.org/buster/dovecot-auth-lua) and OpenSUSE doesn't seem to have it at all (https://build.opensuse.org/package/show/openSUSE:Factory/dovecot).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SuperSandro2000 "If we can't do that then I don't think I work as a reviewer for your PRs." amen to that. You really don't. Why do you think I blocked you? Because I "value" your "insights". But as I said, I won't push for this anymore. Or much else for that matter, because why would I? So yeah, do all of us a favor and don't touch my PRs anymore.

@@ -1,8 +1,9 @@
{ stdenv, lib, fetchurl, perl, pkgconfig, systemd, openssl
{ stdenv, lib, fetchurl, fetchpatch, perl, pkgconfig, systemd, openssl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ stdenv, lib, fetchurl, fetchpatch, perl, pkgconfig, systemd, openssl
{ stdenv, lib, fetchurl, fetchpatch, perl, pkg-config, systemd, openssl

, bzip2, zlib, lz4, inotify-tools, pam, libcap
, clucene_core_2, icu, openldap, libsodium, libstemmer, cyrus_sasl
, nixosTests
# Auth modules
, withLua ? true, lua, autoreconfHook
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, this must be optional.

pkgs/servers/mail/dovecot/default.nix Show resolved Hide resolved
@ajs124 ajs124 closed this Jan 16, 2021
@ajs124 ajs124 deleted the feat/dovecot-lua branch January 16, 2021 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants