From cf3867a5efbbc36743cc7009e33c872cfe3fa232 Mon Sep 17 00:00:00 2001 From: Nathan Bijnens Date: Sat, 23 Jul 2016 18:00:10 +0200 Subject: [PATCH 1/2] Fix #9759 SSMTP sendmail wrapper --- nixos/modules/programs/ssmtp.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/nixos/modules/programs/ssmtp.nix b/nixos/modules/programs/ssmtp.nix index 7b00efbb4686..ee5ac02d1316 100644 --- a/nixos/modules/programs/ssmtp.nix +++ b/nixos/modules/programs/ssmtp.nix @@ -100,6 +100,12 @@ in Password used for SMTP auth. (STORED PLAIN TEXT, WORLD-READABLE IN NIX STORE) ''; }; + + setSendmail = mkOption { + type = types.bool; + default = true; + description = "Whether to set the system sendmail to ssmtp's."; + }; }; @@ -122,6 +128,13 @@ in ''; environment.systemPackages = [pkgs.ssmtp]; + + services.mail.sendmailSetuidWrapper = mkIf networking.defaultMailServer.setSendmail { + program = "sendmail"; + source = "${pkgs.ssmtp}/bin/sendmail"; + setuid = false; + setgid = false; + }; }; From bb528e714d677f619db732fc66795bf0f6375204 Mon Sep 17 00:00:00 2001 From: Nathan Bijnens Date: Sat, 23 Jul 2016 20:58:58 +0200 Subject: [PATCH 2/2] Fix #9759 SSMTP sendmail wrapper - cfg instead of full path --- nixos/modules/programs/ssmtp.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/programs/ssmtp.nix b/nixos/modules/programs/ssmtp.nix index ee5ac02d1316..f5d1873cc5c8 100644 --- a/nixos/modules/programs/ssmtp.nix +++ b/nixos/modules/programs/ssmtp.nix @@ -129,7 +129,7 @@ in environment.systemPackages = [pkgs.ssmtp]; - services.mail.sendmailSetuidWrapper = mkIf networking.defaultMailServer.setSendmail { + services.mail.sendmailSetuidWrapper = mkIf cfg.setSendmail { program = "sendmail"; source = "${pkgs.ssmtp}/bin/sendmail"; setuid = false;