use opensmtpd

This commit is contained in:
Christoph Cullmann 2024-07-07 16:40:50 +02:00
parent b386443842
commit 05b3bba25f
No known key found for this signature in database

View file

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