diff --git a/nixos/modules/mailman.nix b/nixos/modules/mailman.nix index 00d04d3..e6eb8f5 100644 --- a/nixos/modules/mailman.nix +++ b/nixos/modules/mailman.nix @@ -2,7 +2,6 @@ { config, lib, - pkgs, ... }: let inherit @@ -80,16 +79,15 @@ in { description = "Post the mail addresses used by mailman to the HRZ allow list"; script = '' # Parse addresses - cut -d '@' -f 1 /var/lib/mailman/data/postfix_lmtp | grep -v '#' | grep "\S" > /tmp/addresses + awk '{print $1}' /var/lib/mailman/data/postfix_lmtp | grep -v '#' | grep "\S" > addresses # Post addresses to HRZ - ${pkgs.curl}/bin/curl https://www-cgi.hrz.tu-darmstadt.de/mail/whitelist-update.php -F emaildomain=lists.mathebau.de -F password=$(cat /run/secrets/allowlistPass) -F emailliste=@/tmp/addresses -F meldungen=voll + curl https://www-cgi.hrz.tu-darmstadt.de/mail/whitelist-update.php -F emaildomain=lists.mathebau.de -F password=$(cat /run/secrets/allowlistPass) -F emailliste=@addresses -F meldungen=voll # Cleanup - rm /tmp/addresses + rm addresses ''; serviceConfig = { Type = "oneshot"; User = "mailman"; - PrivateTmp = true; }; }; sops.secrets.allowlistPass = {