Use postfix options for routing mails through tunnel #45

Closed
esavkin wants to merge 15 commits from enable-mail-proxy-and-tunnel into master
1 changed files with 11 additions and 2 deletions
Showing only changes of commit 4c9dff8d95 - Show all commits

View File

@ -1259,14 +1259,18 @@ in
Restart = "on-failure"; Restart = "on-failure";
User = "hydra-queue-runner"; # TODO needs new user both here and there User = "hydra-queue-runner"; # TODO needs new user both here and there
Group = "hydra"; 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";
}; };
}; };
sb10q marked this conversation as resolved Outdated
Outdated
Review

"smtptun" is quite a confusing name. You'd think it's some postfix internal option. Make it more specific and explicit.

"smtptun" is quite a confusing name. You'd think it's some postfix internal option. Make it more specific and explicit.
environment.etc."postfix/sender_relay".text = '' environment.etc."postfix/sender_relay".text = ''
@m-labs-intl.com [localhost]:1587 m-labs-intl.com socks:
Outdated
Review

In https://www.postfix.org/transport.5.html I don't see the syntax @domain. Just domain. What is going on?

In https://www.postfix.org/transport.5.html I don't see the syntax ``@domain``. Just ``domain``. What is going on?

I checked previously and it just didn't work until I used @domain

I checked previously and it just didn't work until I used `@domain`
Outdated
Review

Why the apparent discrepancy with the documentation? How carefully did you check?

Why the apparent discrepancy with the documentation? How carefully did you check?
* : * :
sb10q marked this conversation as resolved Outdated
Outdated
Review

Is this really required? I would expect NixOS to deal by itself with services.postfix.mapFiles without requiring any additional user-defined systemd services.

Is this really required? I would expect NixOS to deal by itself with ``services.postfix.mapFiles`` without requiring any additional user-defined systemd services.
Outdated
Review

https://github.com/NixOS/nixpkgs/blob/nixos-24.05/nixos/modules/services/mail/postfix.nix#L752-L755

Does this not work for some reason, or is it your usual sloppiness?

https://github.com/NixOS/nixpkgs/blob/nixos-24.05/nixos/modules/services/mail/postfix.nix#L752-L755 Does this not work for some reason, or is it your usual sloppiness?
''; '';
Outdated
Review

Is the line * : needed?

Is the line ``* :`` needed?
environment.etc."tsocks.conf".text = ''
server = 127.0.0.1
server_port = 1587
'';
systemd.services.postfix-rebuild-sender-relay = { systemd.services.postfix-rebuild-sender-relay = {
description = "Postfix Rebuild Sender Dependent Relayhost Maps"; description = "Postfix Rebuild Sender Dependent Relayhost Maps";
serviceConfig = { serviceConfig = {
@ -1289,6 +1293,11 @@ in
sender_dependent_relayhost_maps = "hash:/etc/postfix/sender_relay"; sender_dependent_relayhost_maps = "hash:/etc/postfix/sender_relay";
postscreen_upstream_proxy_protocol = "haproxy"; postscreen_upstream_proxy_protocol = "haproxy";
postscreen_upstream_proxy_timeout = "5s"; 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 = { services.roundcube = {