nix-files/services-conf/postfix-configuration.nix
Colin 6688b3bc00 postfix: run behind ovpns
this gives us a static IPv4 IP address which has an unblocked SMTP port.
2022-05-03 00:44:15 +00:00

35 lines
1.0 KiB
Nix

{ config, pkgs, lib, ... }:
{
services.postfix.enable = true;
services.postfix.hostname = "mx.uninsane.org";
services.postfix.origin = "uninsane.org";
services.postfix.destination = ["localhost" "uninsane.org"];
services.postfix.virtual = ''
@uninsane.org colin
'';
services.postfix.extraConfig = ''
# smtpd_milters = local:/run/opendkim/opendkim.sock
smtpd_milters = inet:localhost:8891
non_smtpd_milters = $smtpd_milters
milter_default_action = accept
'';
services.opendkim.enable = true;
services.opendkim.domains = "csl:uninsane.org";
# we use a custom (inet) socket, because the default perms
# of the unix socket don't allow postfix to connect
services.opendkim.socket = "inet:8891@localhost";
# selectors can be used to disambiguate sender machines.
# keeping this the same as the hostname seems simplest
services.opendkim.selector = "mx";
systemd.services.postfix.serviceConfig = {
# run this behind the OVPN static VPN
NetworkNamespacePath = "/run/netns/ovpns";
};
}