From 44e678f941d62bfc19d27f86456976954c459233 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Sat, 13 Mar 2021 19:08:15 -0500 Subject: Set up email alerting in grafana --- modules/postfix.nix | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 modules/postfix.nix (limited to 'modules/postfix.nix') diff --git a/modules/postfix.nix b/modules/postfix.nix new file mode 100644 index 0000000..23f9919 --- /dev/null +++ b/modules/postfix.nix @@ -0,0 +1,27 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.orbekk.postfix; +in +{ + options = { + orbekk.postfix = { + enable = lib.mkEnableOption "Enable postfix config"; + }; + }; + + config = lib.mkIf cfg.enable { + services.postfix = { + enable = true; + hostname = "${config.networking.hostName}.orbekk.com"; + config = { + relayhost = "[smtp.fastmail.com]:465"; + smtp_sasl_auth_enable = true; + smtp_sasl_security_options = "noanonymous"; + smtp_use_tls = true; + smtp_sasl_password_maps = "hash:/opt/secret/postfix-sasl-passwd"; + smtp_tls_wrappermode = "yes"; + smtp_tls_security_level = lib.mkForce "encrypt"; + }; + }; + }; +} -- cgit v1.2.3