summaryrefslogtreecommitdiff
path: root/modules/postfix.nix
blob: 23f9919e0dfa144b18458b22031043ecec163dd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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";
      };
    };
  };
}