From 355c69f1b04cd1a90b615286945fbccd6a0d9924 Mon Sep 17 00:00:00 2001 From: Egor Savkin Date: Fri, 23 Aug 2024 17:18:56 +0800 Subject: [PATCH] Use tsocks to wrap socks and add sock transport type Signed-off-by: Egor Savkin --- nixbld-etc-nixos/configuration.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/nixbld-etc-nixos/configuration.nix b/nixbld-etc-nixos/configuration.nix index 28a75d9..acbb2cf 100644 --- a/nixbld-etc-nixos/configuration.nix +++ b/nixbld-etc-nixos/configuration.nix @@ -1214,14 +1214,18 @@ in Restart = "on-failure"; User = "hydra-queue-runner"; # TODO needs new user both here and there Group = "hydra"; - ExecStart = "${pkgs.openssh}/bin/ssh -N -L 127.0.0.1:1587:5.78.86.156:1587 zolaupd@5.78.86.156"; + ExecStart = "${pkgs.openssh}/bin/ssh -N -D 127.0.0.1:1587 zolaupd@5.78.86.156"; }; }; environment.etc."postfix/sender_relay".text = '' - @m-labs-intl.com [localhost]:1587 + m-labs-intl.com socks: * : ''; + environment.etc."tsocks.conf".text = '' + server = 127.0.0.1 + server_port = 1587 + ''; systemd.services.postfix-rebuild-sender-relay = { description = "Postfix Rebuild Sender Dependent Relayhost Maps"; serviceConfig = { @@ -1244,6 +1248,11 @@ in sender_dependent_relayhost_maps = "hash:/etc/postfix/sender_relay"; postscreen_upstream_proxy_protocol = "haproxy"; postscreen_upstream_proxy_timeout = "5s"; + masterConfig.socks = { + type = "unix"; + command = "pipe"; + args = "flags=R user=nobody argv=${pkgs.tsocks}/bin/tsocks ${pkgs.postfix}/bin/sendmail -oi -f $sender $recipient"; + }; }; }; services.roundcube = {