diff --git a/modules/services/msmtp.nix b/modules/services/msmtp.nix index 66de5ad..6f4f78d 100644 --- a/modules/services/msmtp.nix +++ b/modules/services/msmtp.nix @@ -12,6 +12,7 @@ in config = lib.mkIf cfg.enable { programs.msmtp = { enable = true; + defaults.aliases = "/etc/aliases"; accounts.default = { host = config.secrets.services.msmtp.host; user = config.secrets.services.msmtp.user; @@ -21,8 +22,15 @@ in tls_starttls = true; port = 587; from = "${config.networking.hostName}@${config.secrets.networking.primaryDomain}"; - to = config.secrets.users.aires.email; }; }; + + # Send all mail to my email address by default + environment.etc."aliases" = { + text = '' + default: ${config.secrets.users.aires.email} + ''; + mode = "0644"; + }; }; }