extract mailer role
2 files changed, 60 insertions(+), 49 deletions(-)
changed files
M system/hosts/linde.nix → system/hosts/linde.nix
@@ -36,6 +36,7 @@ ../roles/auth-dns.nix ../roles/binary-cache.nix ../roles/forgejo-runner.nix ../roles/goatcounter.nix + ../roles/mailer.nix ../roles/readeck.nix ../roles/searchix.nix ../roles/sso.nix@@ -283,55 +284,6 @@ services.powerdns.extraConfig = '' local-address=${net-ip4} ${net-ip6} ''; - - services.postfix = { - enable = true; - enableSubmission = true; - submissionOptions = { - smtpd_client_restrictions = "permit_inet_interfaces,reject"; - smtpd_tls_security_level = "none"; - }; - enableSubmissions = true; - virtual = '' - @${config.networking.hostName}.${domain} alin - alin ${email} - ''; - settings = { - main = { - mydomain = domain; - mydestination = [ ]; - inet_interfaces = "loopback-only"; - smtp_bind_address = "0.0.0.0"; - smtp_bind_address6 = "::"; - }; - }; - }; - services.rspamd = { - enable = true; - postfix = { - enable = true; - }; - locals = { - "outgoing.conf".text = '' - outbound { - priority = high; - authenticated = yes; - apply { - groups_disabled = ["rbl", "spf", "dmarc"]; - actions { - greylist = null; - } - } - } - ''; - "dkim_signing.conf".text = '' - enabled = true; - selector = "202602"; - domain = "alin.ovh"; - path = "/var/dkim/$domain.$selector.key"; - ''; - }; - }; systemd.services.backup-gitolite = { startAt = "daily";
A system/roles/mailer.nix
@@ -0,0 +1,59 @@ +{ + config, + ... +}: +let + email = "alan@alanpearce.eu"; + domain = config.networking.domain; +in +{ + + services.postfix = { + enable = true; + enableSubmission = true; + submissionOptions = { + smtpd_client_restrictions = "permit_inet_interfaces,reject"; + smtpd_tls_security_level = "none"; + }; + enableSubmissions = true; + virtual = '' + @${config.networking.hostName}.${domain} alin + alin ${email} + ''; + settings = { + main = { + mydomain = domain; + mydestination = [ ]; + inet_interfaces = "loopback-only"; + smtp_bind_address = "0.0.0.0"; + smtp_bind_address6 = "::"; + }; + }; + }; + services.rspamd = { + enable = true; + postfix = { + enable = true; + }; + locals = { + "outgoing.conf".text = '' + outbound { + priority = high; + authenticated = yes; + apply { + groups_disabled = ["rbl", "spf", "dmarc"]; + actions { + greylist = null; + } + } + } + ''; + "dkim_signing.conf".text = '' + enabled = true; + selector = "202602"; + domain = "alin.ovh"; + path = "/var/dkim/$domain.$selector.key"; + ''; + }; + }; +}