diff --git a/nixos/modules/mail.nix b/nixos/modules/mail.nix index 9330b39..37cf340 100644 --- a/nixos/modules/mail.nix +++ b/nixos/modules/mail.nix @@ -156,21 +156,6 @@ in { }; session = { - ehlo.require = [ - { - "if" = "starts_with(remote_ip, '192.168.0.')"; #TODO setup vms properly - "then" = false; - } - {"else" = true;} - ]; - ehlo.reject-non-fqdn = [ - { - "if" = "starts_with(remote_ip, '192.168.0.')"; #TODO setup vms properly - "then" = false; - } - {"else" = true;} - ]; - rcpt = { # In order to accept mail that we only forward # without having to generate an account. @@ -185,7 +170,21 @@ in { {"else" = false;} ]; }; - data.script = "'redirects'"; + + ehlo.require = [ + { + "if" = "starts_with(remote_ip, '192.168.0.')"; #TODO setup vms properly + "then" = false; + } + {"else" = true;} + ]; + ehlo.reject-non-fqdn = [ + { + "if" = "starts_with(remote_ip, '192.168.0.')"; #TODO setup vms properly + "then" = false; + } + {"else" = true;} + ]; }; # Stalwart gets its configuration from two places: A TOML configuration file that we control in this module @@ -230,6 +229,7 @@ in { out-messages = 50; }; }; + session.data.script = "'redirects'"; # See https://stalw.art/docs/smtp/authentication/dkim/sign # We need two blocks per domain because the domain setting in the blocks does not accept variables like `sender_domain`.