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 18 additions and 1 deletions

View File

@ -1260,8 +1260,25 @@ in
enablePop3 = true;
enablePop3Ssl = true;
certificateScheme = "acme-nginx";
policydSPFExtraConfig = "skip_addresses = 5.78.86.156,2a01:4ff:1f0:83de::1";
} // (import /etc/nixos/secret/email_settings.nix);
services.postfix = {
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.
mapFiles.sender_transport = pkgs.writeText "sender_transport" ''
@m-labs-intl.com intltunnel:
'';
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?
config = {
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?
sender_dependent_default_transport_maps = "hash:/var/lib/postfix/conf/sender_transport";
Outdated
Review

Is the line * : needed?

Is the line ``* :`` needed?
};
masterConfig."intltunnel" = {
type = "unix";
command = "smtp";
args = [
"-o" "inet_interfaces=10.47.3.1"
"-o" "smtp_helo_name=mail.m-labs-intl.com"
"-o" "inet_protocols=ipv4"
];
};
Outdated
Review

Is inet_protocols=ipv4 still needed?

Is inet_protocols=ipv4 still needed?

Yes, otherwise it tries to use ipv6

Yes, otherwise it tries to use ipv6
Outdated
Review

Despite net_interfaces=10.47.3.1 ?

Despite net_interfaces=10.47.3.1 ?

Yes

Yes
};
sb10q marked this conversation as resolved Outdated
Outdated
Review

I have not looked into it, but considering your sloppy code above, this looks suspicious and I recommend you review this and double check that this is the right way of doing it.

I have not looked into it, but considering your sloppy code above, this looks suspicious and I recommend you review this and double check that this is the right way of doing it.
services.roundcube = {
enable = true;
hostName = "mail.m-labs.hk";