From 1820b0f9585f7a6ce7f63afff5f7fca2f37378de Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Wed, 1 Dec 2021 14:38:53 -0500 Subject: [PATCH] Fix hanging on maddy update --- modules/cloud/mail/default.nix | 12 +++++++++--- nki-personal-do/configuration.nix | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/modules/cloud/mail/default.nix b/modules/cloud/mail/default.nix index aa20e28..cf7c50f 100644 --- a/modules/cloud/mail/default.nix +++ b/modules/cloud/mail/default.nix @@ -18,6 +18,8 @@ in options.cloud.mail = { enable = mkEnableOption "Enable the email server"; + debug = mkEnableOption "Enable debugging"; + package = mkOption { type = types.package; default = pkgs.maddy; @@ -275,7 +277,7 @@ in serviceConfig = { Type = "notify"; - NotifyAccess = "main"; + NotifyAccess = "exec"; User = name; Group = name; @@ -335,9 +337,13 @@ in Restart = "on-failure"; # ... Unless it is a configuration problem. RestartPreventExitStatus = 2; + + ExecStart = "${cfg.package}/bin/maddy ${if cfg.debug then "-debug " else ""}-config ${configFile}"; }; - script = "${cfg.package}/bin/maddy -config ${configFile}"; - reload = "/bin/kill -USR1 $MAINPID"; + reload = '' + /bin/kill -USR1 $MAINPID + /bin/kill -USR2 $MAINPID + ''; }; }; } diff --git a/nki-personal-do/configuration.nix b/nki-personal-do/configuration.nix index 89aba91..45dfe47 100644 --- a/nki-personal-do/configuration.nix +++ b/nki-personal-do/configuration.nix @@ -60,6 +60,7 @@ sops.secrets.mail-users = { owner = "maddy"; }; cloud.mail = { enable = true; + debug = true; tls.certFile = "${config.cloud.traefik.certsDumper.destination}/${config.cloud.mail.hostname}/certificate.crt"; tls.keyFile = "${config.cloud.traefik.certsDumper.destination}/${config.cloud.mail.hostname}/privatekey.key"; usersFile = config.sops.secrets.mail-users.path;