Fix postfix settings so it should load successfully

Signed-off-by: Egor Savkin <es@m-labs.hk>
This commit is contained in:
Egor Savkin 2024-10-07 16:43:43 +08:00
parent 451328c28b
commit 95ee041e13
2 changed files with 13 additions and 12 deletions

View File

@ -230,7 +230,7 @@ in
}; };
greTunnels.intl0 = { greTunnels.intl0 = {
dev = netifWan; dev = netifWan;
remote = "5.78.16.0"; remote = "5.78.86.156";
local = "94.190.212.123"; local = "94.190.212.123";
ttl = 255; ttl = 255;
type = "tun"; type = "tun";
@ -305,7 +305,7 @@ in
}; };
services.strongswan-swanctl.swanctl.connections.intl = { services.strongswan-swanctl.swanctl.connections.intl = {
local_addrs = [ "94.190.212.123" ]; local_addrs = [ "94.190.212.123" ];
remote_addrs = [ "5.78.16.0" ]; remote_addrs = [ "5.78.86.156" ];
local.main = { local.main = {
auth = "pubkey"; auth = "pubkey";
id = "fqdn:m-labs.hk"; id = "fqdn:m-labs.hk";
@ -319,7 +319,7 @@ in
children.intl0 = { children.intl0 = {
mode = "transport"; mode = "transport";
ah_proposals = [ "sha256-curve25519" ]; ah_proposals = [ "sha256-curve25519" ];
remote_ts = [ "5.78.16.0[gre]" ]; remote_ts = [ "5.78.86.156[gre]" ];
local_ts = [ "94.190.212.123[gre]" ]; local_ts = [ "94.190.212.123[gre]" ];
start_action = "start"; start_action = "start";
}; };
@ -1260,14 +1260,14 @@ in
}; };
}; };
environment.etc."postfix/sender_relay".text = '' services.postfix.mapFiles.sender_relay = pkgs.writeText "sender_relay" ''
m-labs-intl.com smtptun: m-labs-intl.com smtptun:
* : * :
''; '';
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 = {
ExecStart = "${pkgs.postfix}/sbin/postmap /etc/postfix/sender_relay"; ExecStart = "${pkgs.postfix}/sbin/postmap /var/lib/postfix/conf/sender_relay";
}; };
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
}; };
@ -1283,14 +1283,15 @@ in
} // (import /etc/nixos/secret/email_settings.nix); } // (import /etc/nixos/secret/email_settings.nix);
services.postfix = { services.postfix = {
config = { config = {
sender_dependent_relayhost_maps = "hash:/etc/postfix/sender_relay"; sender_dependent_relayhost_maps = "hash:/var/lib/postfix/conf/sender_relay";
masterConfig.smtptun = { };
type = "smtp"; masterConfig."smtptun" = {
type = "unix";
command = "smtp"; command = "smtp";
args = "-o smtp_bind_address=10.47.3.2"; args = [ "-o" "smtp_bind_address=10.47.3.2" ];
};
}; };
}; };
services.roundcube = { services.roundcube = {
enable = true; enable = true;
hostName = "mail.m-labs.hk"; hostName = "mail.m-labs.hk";

View File

@ -22,7 +22,7 @@ $TTL 7200
ns A 94.190.212.123 ns A 94.190.212.123
ns AAAA 2001:470:18:390::2 ns AAAA 2001:470:18:390::2
mail A 5.78.16.0 mail A 5.78.86.156
mail._domainkey IN TXT "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDJVPuhSGXghO7ib8Em/Se3jfCCIJK5g4zn5pGZ3/e0I0f+zGHMuvwpjkAKf6eSmo/AAXEaco28pDi3qE5xfV512AJsORCfPoPFyNhLsj/qtri6hc5KVSWW0Ja3MSFBINDCaX78c7PXPY+3jJJGpwSBDLjdxj9AQwtfiCVlH4qE/QIDAQAB" mail._domainkey IN TXT "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDJVPuhSGXghO7ib8Em/Se3jfCCIJK5g4zn5pGZ3/e0I0f+zGHMuvwpjkAKf6eSmo/AAXEaco28pDi3qE5xfV512AJsORCfPoPFyNhLsj/qtri6hc5KVSWW0Ja3MSFBINDCaX78c7PXPY+3jJJGpwSBDLjdxj9AQwtfiCVlH4qE/QIDAQAB"
_dmarc TXT "v=DMARC1; p=none" _dmarc TXT "v=DMARC1; p=none"