diff --git a/nixos/modules/services/mail/mailman.nix b/nixos/modules/services/mail/mailman.nix index a604f32b3371..3744214ca49f 100644 --- a/nixos/modules/services/mail/mailman.nix +++ b/nixos/modules/services/mail/mailman.nix @@ -185,7 +185,11 @@ in { enable = "yes"; configuration = "/var/lib/mailman/mailman-hyperkitty.cfg"; }; - }; + } // (let + loggerNames = ["root" "archiver" "bounce" "config" "database" "debug" "error" "fromusenet" "http" "locks" "mischief" "plugins" "runner" "smtp"]; + loggerSectionNames = map (n: "logging.${n}") loggerNames; + in lib.genAttrs loggerSectionNames(name: { handler = "stderr"; }) + ); assertions = let inherit (config.services) postfix; diff --git a/pkgs/servers/mail/mailman/default.nix b/pkgs/servers/mail/mailman/default.nix index 37b4d29eeb16..879fd19adb0a 100644 --- a/pkgs/servers/mail/mailman/default.nix +++ b/pkgs/servers/mail/mailman/default.nix @@ -1,4 +1,4 @@ -{ stdenv, buildPythonPackage, fetchPypi, isPy3k, alembic, aiosmtpd, dnspython +{ stdenv, buildPythonPackage, fetchPypi, fetchpatch, isPy3k, alembic, aiosmtpd, dnspython , flufl_bounce, flufl_i18n, flufl_lock, lazr_config, lazr_delegates, passlib , requests, zope_configuration, click, falcon, importlib-resources , zope_component, lynx, postfix, authheaders, gunicorn @@ -20,7 +20,19 @@ buildPythonPackage rec { zope_component authheaders gunicorn ]; - patchPhase = '' + patches = [ + (fetchpatch { + url = https://gitlab.com/mailman/mailman/-/commit/4b206e2a5267a0e17f345fd7b2d957122ba57566.patch; + sha256 = "06axmrn74p81wvcki36c7gfj5fp5q15zxz2yl3lrvijic7hbs4n2"; + }) + (fetchpatch { + url = https://gitlab.com/mailman/mailman/-/commit/9613154f3c04fa2383fbf017031ef263c291418d.patch; + sha256 = "0vyw87s857vfxbf7kihwb6w094xyxmxbi1bpdqi3ybjamjycp55r"; + }) + ./log-stderr.patch + ]; + + postPatch = '' substituteInPlace src/mailman/config/postfix.cfg \ --replace /usr/sbin/postmap ${postfix}/bin/postmap substituteInPlace src/mailman/config/schema.cfg \ diff --git a/pkgs/servers/mail/mailman/log-stderr.patch b/pkgs/servers/mail/mailman/log-stderr.patch new file mode 100644 index 000000000000..2edbe1f18313 --- /dev/null +++ b/pkgs/servers/mail/mailman/log-stderr.patch @@ -0,0 +1,13 @@ +diff --git a/src/mailman/core/logging.py b/src/mailman/core/logging.py +index f8f87279f..7ff13b003 100644 +--- a/src/mailman/core/logging.py ++++ b/src/mailman/core/logging.py +@@ -142,6 +142,8 @@ def _init_logger(propagate, sub_name, log, logger_config): + address, facility = _get_syslog_params(logger_config) + handler = logging.handlers.SysLogHandler( + address=address, facility=facility) ++ elif logger_config.handler == 'stderr': ++ handler = logging.StreamHandler(sys.stderr) + else: + path_str = logger_config.path + path_abs = os.path.normpath(os.path.join(config.LOG_DIR, path_str))