extract mailer role
1 file changed, 59 insertions(+), 0 deletions(-)
changed files
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"; + ''; + }; + }; +}