From e05c9acce708e8467817e0f3b7367c299c41dc40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Sun, 23 Feb 2020 14:12:12 +0100 Subject: Prepare script for opensmtpd next upgrade --- modules/private/mail/opensmtpd.nix | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'modules/private/mail/opensmtpd.nix') diff --git a/modules/private/mail/opensmtpd.nix b/modules/private/mail/opensmtpd.nix index e4a6140..a7be066 100644 --- a/modules/private/mail/opensmtpd.nix +++ b/modules/private/mail/opensmtpd.nix @@ -15,12 +15,21 @@ users.users.smtpd.extraGroups = [ "keys" ]; services.opensmtpd = { enable = true; - serverConfiguration = '' + 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 + # FIXME: filtering requires 6.6, uncomment following lines when + # upgrading # filter "fixfrom" \ - # proc-exec "${pkgs.procmail}/bin/formail -i 'From: ${name}@immae.eu'" + # 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 \ -- cgit v1.2.3