@@ -21,9 +21,11 @@ in
2121 (mkRenamedOptionModule [ "networking" "defaultMailServer" "useTLS" ] [ "services" "ssmtp" "useTLS" ])
2222 (mkRenamedOptionModule [ "networking" "defaultMailServer" "useSTARTTLS" ] [ "services" "ssmtp" "useSTARTTLS" ])
2323 (mkRenamedOptionModule [ "networking" "defaultMailServer" "authUser" ] [ "services" "ssmtp" "authUser" ])
24− (mkRenamedOptionModule [ "networking" "defaultMailServer" "authPass" ] [ "services" "ssmtp" "authPass" ])
2524 (mkRenamedOptionModule [ "networking" "defaultMailServer" "authPassFile" ] [ "services" "ssmtp" "authPassFile" ])
2625 (mkRenamedOptionModule [ "networking" "defaultMailServer" "setSendmail" ] [ "services" "ssmtp" "setSendmail" ])
26+
27+ (mkRemovedOptionModule [ "networking" "defaultMailServer" "authPass" ] "authPass has been removed since it leaks the clear-text password into the world-readable store. Use authPassFile instead and make sure it's not a store path")
28+ (mkRemovedOptionModule [ "services" "ssmtp" "authPass" ] "authPass has been removed since it leaks the clear-text password into the world-readable store. Use authPassFile instead and make sure it's not a store path")
2729 ];
2830
2931 options = {
@@ -116,18 +118,6 @@ in
116118 '';
117119 };
118120
119− authPass = mkOption {
120− type = types.str;
121− default = "";
122− example = "correctHorseBatteryStaple";
123− description = ''
124− Password used for SMTP auth. (STORED PLAIN TEXT, WORLD-READABLE IN NIX STORE)
125−
126− It's recommended to use <option>authPassFile</option>
127− which takes precedence over <option>authPass</option>.
128− '';
129− };
130−
131121 authPassFile = mkOption {
132122 type = types.nullOr types.str;
133123 default = null;
@@ -136,11 +126,6 @@ in
136126 Path to a file that contains the password used for SMTP auth. The file
137127 should not contain a trailing newline, if the password does not contain one.
138128 This file should be readable by the users that need to execute ssmtp.
139−
140− <option>authPassFile</option> takes precedence over <option>authPass</option>.
141−
142− Warning: when <option>authPass</option> is non-empty <option>authPassFile</option>
143− defaults to a file in the WORLD-READABLE Nix store containing that password.
144129 '';
145130 };
146131
@@ -157,12 +142,6 @@ in
157142
158143 config = mkIf cfg.enable {
159144
160− services.ssmtp.authPassFile = mkIf (cfg.authPass != "")
161− (mkDefault (toString (pkgs.writeTextFile {
162− name = "ssmtp-authpass";
163− text = cfg.authPass;
164− })));
165−
166145 services.ssmtp.settings = mkMerge [
167146 ({
168147 MailHub = cfg.hostName;