Make sure DO node only uses the fixed local_ip address when trying to send mails

This commit is contained in:
Natsu Kagami 2022-11-14 16:50:11 +01:00
parent 215740fb7b
commit ccb91b4feb
Signed by: nki
GPG key ID: 7306B3D3C3AD6E51
2 changed files with 8 additions and 0 deletions

View file

@ -31,6 +31,12 @@ in
description = "The hostname where the server is run on"; description = "The hostname where the server is run on";
}; };
local_ip = mkOption {
type = types.str;
default = "";
description = "The local IP address used as the sender IP during delivery";
};
primaryDomain = mkOption { primaryDomain = mkOption {
type = types.str; type = types.str;
default = "nkagami.me"; default = "nkagami.me";
@ -185,6 +191,7 @@ in
min_mx_level none min_mx_level none
} }
} }
${if cfg.local_ip == "" then "" else "local_ip ${cfg.local_ip}"}
} }
target.queue remote_queue { target.queue remote_queue {

View file

@ -74,6 +74,7 @@
cloud.mail = { cloud.mail = {
enable = true; enable = true;
debug = true; debug = true;
local_ip = "178.128.135.11"; # resolved from mx1.nkagami.me
tls.certFile = "${config.cloud.traefik.certsDumper.destination}/${config.cloud.mail.hostname}/certificate.crt"; tls.certFile = "${config.cloud.traefik.certsDumper.destination}/${config.cloud.mail.hostname}/certificate.crt";
tls.keyFile = "${config.cloud.traefik.certsDumper.destination}/${config.cloud.mail.hostname}/privatekey.key"; tls.keyFile = "${config.cloud.traefik.certsDumper.destination}/${config.cloud.mail.hostname}/privatekey.key";
usersFile = config.sops.secrets.mail-users.path; usersFile = config.sops.secrets.mail-users.path;