fixed dkim

This commit is contained in:
Rouven Seifert 2023-03-01 15:23:07 +01:00
parent eee6282d69
commit 041628def7
Signed by: rouven.seifert
GPG key ID: B95E8FE6B11C4D09

View file

@ -3,7 +3,6 @@ let
hostname = "mail.${config.fsr.domain}"; hostname = "mail.${config.fsr.domain}";
domain = config.fsr.domain; domain = config.fsr.domain;
rspamd-domain = "rspamd.${config.fsr.domain}"; rspamd-domain = "rspamd.${config.fsr.domain}";
dkim-selector = "quitte";
# brauchen wir das überhaupt? # brauchen wir das überhaupt?
#ldap-aliases = pkgs.writeText "ldap-aliases.cf" '' #ldap-aliases = pkgs.writeText "ldap-aliases.cf" ''
#server_host = ldap://localhost #server_host = ldap://localhost
@ -29,6 +28,7 @@ in
sops.secrets."dovecot_ldap_search".owner = config.services.dovecot2.user; sops.secrets."dovecot_ldap_search".owner = config.services.dovecot2.user;
networking.firewall.allowedTCPPorts = [ 25 465 993 ]; networking.firewall.allowedTCPPorts = [ 25 465 993 ];
users.users.postfix.extraGroups = ["opendkim"];
services = { services = {
postfix = { postfix = {
@ -53,10 +53,11 @@ in
"reject_unauth_destination" "reject_unauth_destination"
]; ];
#alias_maps = [ "ldap:${ldap-aliases}" ]; #alias_maps = [ "ldap:${ldap-aliases}" ];
smtpd_milters = [ "local:/run/opendkim/opendkim.sock" ];
non_smtpd_milters = [ "local:/var/run/opendkim/opendkim.sock" ];
smtpd_sasl_auth_enable = true; smtpd_sasl_auth_enable = true;
smtpd_sasl_path = "/var/lib/postfix/auth"; smtpd_sasl_path = "/var/lib/postfix/auth";
smtpd_sasl_type = "dovecot"; smtpd_sasl_type = "dovecot";
#mailbox_transport = "lmtp:unix:/run/dovecot2/dovecot-lmtp";
virtual_mailbox_base = "/var/mail"; virtual_mailbox_base = "/var/mail";
}; };
}; };
@ -64,7 +65,6 @@ in
enable = true; enable = true;
enableImap = true; enableImap = true;
enableQuota = false; enableQuota = false;
#enableLmtp = true;
sslServerCert = "/var/lib/acme/${hostname}/fullchain.pem"; sslServerCert = "/var/lib/acme/${hostname}/fullchain.pem";
sslServerKey = "/var/lib/acme/${hostname}/key.pem"; sslServerKey = "/var/lib/acme/${hostname}/key.pem";
mailboxes = { mailboxes = {
@ -102,13 +102,14 @@ in
user = postfix user = postfix
} }
} }
# service lmtp { '';
# unix_listener dovecot-lmtp { };
# group = postfix opendkim = {
# mode = 0660 enable = true;
# user = postfix domains = "csl:${config.fsr.domain}";
# } selector = config.networking.hostName;
# } configFile = pkgs.writeText "opendkim-config" ''
UMask 0117
''; '';
}; };
rspamd = { rspamd = {
@ -120,12 +121,6 @@ in
read_servers = "127.0.0.1"; read_servers = "127.0.0.1";
write_servers = "127.0.0.1"; write_servers = "127.0.0.1";
''; '';
"dkim_signing.conf".text = ''
path = "/var/lib/rspamd/dkim/${domain}.${dkim-selector}.key";
selector = ${dkim-selector};
sign_authenticated = true;
use_domain = "header";
'';
}; };
}; };
redis = { redis = {