nixcfg/systems/x86_64-linux/sgx/mail.nix
Harald Hoyer 2e28118edf fix(mail.nix): update virtual alias mappings for root/admin
Adjusted the virtual_alias_maps to properly include both root and admin email forwarding. Removed unused rootAlias line and ensured the configuration aligns with intended email routing behavior.
2025-05-21 09:41:36 +02:00

28 lines
741 B
Nix

{ pkgs, config, ... }:
{
environment.systemPackages = with pkgs; [
mailutils
mutt
];
services.postfix = {
enable = true;
relayHost = "smtp.gmail.com";
relayPort = 587;
config = {
smtp_use_tls = "yes";
smtp_sasl_auth_enable = "yes";
smtp_sasl_security_options = "";
smtp_sasl_password_maps = "texthash:${config.sops.secrets.sasl_passwd.path}";
# optional: Forward mails to root (e.g. from cron jobs, smartd)
virtual_alias_maps = "inline:{ root=harald.hoyer@gmail.com, admin=harald.hoyer@gmail.com }";
};
};
sops.secrets.sasl_passwd = {
sopsFile = ../../../.secrets/sgx/relay.yaml; # bring your own password file
owner = config.services.postfix.user;
};
}