diff options
author | Christoph Cullmann <christoph@cullmann.io> | 2024-07-07 16:40:50 +0200 |
---|---|---|
committer | Christoph Cullmann <christoph@cullmann.io> | 2024-07-07 16:40:50 +0200 |
commit | 05b3bba25fe8818647afb7f895b5923b4d09ddba (patch) | |
tree | 81642c8344c07dfa429a6aa31bd78c60bd2ff8be | |
parent | b38644384213f87ed0a1709e1dd96501b23e5060 (diff) |
use opensmtpd
-rw-r--r-- | common.nix | 48 |
1 files changed, 22 insertions, 26 deletions
@@ -334,12 +334,14 @@ in libreoffice libva-utils lsof + mailutils mc micro pkgs.kdePackages.neochat nixos-install-tools nmap nvme-cli + procmail okteta pkgs.kdePackages.okular p7zip @@ -459,24 +461,27 @@ in # dconf is needed for gtk, see https://nixos.wiki/wiki/KDE programs.dconf.enable = true; - # ensure cron and Co. can send mails - programs.msmtp = { + # ensure machine can send mails + services.opensmtpd = { enable = true; setSendmail = true; - accounts = { - default = { - auth = true; - tls = true; - from = "christoph@cullmann.io"; - host = "moon.babylon2k.com"; - port = "587"; - user = builtins.readFile "/data/nixos/mailuser.secret"; - passwordeval = "cat /data/nixos/mailpassword.secret"; - }; - }; - defaults = { - aliases = "/etc/aliases"; - }; + serverConfiguration = '' + table aliases file:/etc/mail/aliases + table secrets file:/etc/mail/secrets + listen on lo + action "local" mda "procmail -f -" virtual <aliases> + action "relay" relay host smtps://smtp@moon.babylon2k.com auth <secrets> mail-from bot@cullmann.io + match for local action "local" + match for any action "relay" + ''; + }; + environment.etc."mail/aliases" = { + text = "@ christoph@cullmann.io"; + mode = "0400"; + }; + environment.etc."mail/secrets" = { + text = builtins.readFile "/data/nixos/mail.secret"; + mode = "0400"; }; # send mails on ZFS events @@ -484,7 +489,7 @@ in settings = { ZED_DEBUG_LOG = "/tmp/zed.debug.log"; ZED_EMAIL_ADDR = [ "root" ]; - ZED_EMAIL_PROG = "${pkgs.msmtp}/bin/msmtp"; + ZED_EMAIL_PROG = "/run/wrappers/bin/sendmail"; ZED_EMAIL_OPTS = "@ADDRESS@"; ZED_NOTIFY_INTERVAL_SECS = 3600; @@ -498,15 +503,6 @@ in enableMail = false; }; - environment.etc = { - "aliases" = { - text = '' - root: christoph@cullmann.io - ''; - mode = "0644"; - }; - }; - # use ZSH per default programs.zsh.enable = true; environment.shells = with pkgs; [ zsh ]; |