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.
28 lines
741 B
Nix
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;
|
|
};
|
|
|
|
}
|