From 1a64deeb894dc95e2645a75771732c6cc53a79ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Wed, 4 Oct 2023 01:35:06 +0200 Subject: Squash changes containing private information There were a lot of changes since the previous commit, but a lot of them contained personnal information about users. All thos changes got stashed into a single commit (history is kept in a different place) and private information was moved in a separate private repository --- modules/private/mail/opensmtpd.nix | 57 -------------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 modules/private/mail/opensmtpd.nix (limited to 'modules/private/mail/opensmtpd.nix') diff --git a/modules/private/mail/opensmtpd.nix b/modules/private/mail/opensmtpd.nix deleted file mode 100644 index e05bba9..0000000 --- a/modules/private/mail/opensmtpd.nix +++ /dev/null @@ -1,57 +0,0 @@ -{ lib, pkgs, config, name, ... }: -{ - config = lib.mkIf config.myServices.mailRelay.enable { - secrets.keys."opensmtpd/creds" = { - user = "smtpd"; - group = "smtpd"; - permissions = "0400"; - text = '' - eldiron ${name}:${config.hostEnv.ldap.password} - ''; - }; - users.users.smtpd.extraGroups = [ "keys" ]; - services.opensmtpd = { - enable = true; - serverConfiguration = let - filter-rewrite-from = pkgs.runCommand "filter-rewrite-from.py" { - buildInputs = [ pkgs.python3 ]; - } '' - cp ${./filter-rewrite-from.py} $out - patchShebangs $out - ''; - in '' - table creds \ - "${config.secrets.fullPaths."opensmtpd/creds"}" - # FIXME: filtering requires 6.6, uncomment following lines when - # upgrading - # filter "fixfrom" \ - # proc-exec "${filter-rewrite-from} ${name}@immae.eu" - # listen on socket filter "fixfrom" - action "relay-rewrite-from" relay \ - helo ${config.hostEnv.fqdn} \ - host smtp+tls://eldiron@eldiron.immae.eu:587 \ - auth \ - mail-from ${name}@immae.eu - action "relay" relay \ - helo ${config.hostEnv.fqdn} \ - host smtp+tls://eldiron@eldiron.immae.eu:587 \ - auth - match for any !mail-from "@immae.eu" action "relay-rewrite-from" - match for any mail-from "@immae.eu" action "relay" - ''; - }; - environment.systemPackages = [ config.services.opensmtpd.package ]; - services.mail.sendmailSetuidWrapper = { - program = "sendmail"; - source = "${config.services.opensmtpd.package}/bin/smtpctl"; - setuid = false; - setgid = false; - }; - security.wrappers.mailq = { - program = "mailq"; - source = "${config.services.opensmtpd.package}/bin/smtpctl"; - setuid = false; - setgid = false; - }; - }; -} -- cgit v1.2.3