Rspamd: Difference between revisions

From NixOS Wiki
imported>Asbachb
mNo edit summary
imported>Onny
Add DKIM key configuration
Line 24: Line 24:
   '';
   '';
};
};
</nowiki>}}
=== DKIM key ===
This module verifies the authenticity of emails through the analysis of DKIM signatures. In this example, we're configure a custom DKIM key file path suitable for the mailserver [[Maddy]] and adjust the group permissions for the Rspamd service.
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
services.rspamd = {
  enable = true;
  locals."dkim_signing.conf".text = ''
    selector = "default";
    path = "/var/lib/maddy/dkim_keys/$domain_$selector.key";
  '';
};
systemd.services.rspamd.serviceConfig.SupplementaryGroups = [ "maddy" ];
</nowiki>}}
</nowiki>}}


[[Category:Mail Server]]
[[Category:Mail Server]]

Revision as of 12:13, 27 August 2023

Rspamd is a fast, free and open-source spam filtering system.

Installation

To enable Rspamd add following line to your system configuration

/etc/nixos/configuration.nix
services.rspamd.enable = true;

Configuration

Whitelist domain

To whitelist a specific domain (in this example the domain example.org) which otherwise gets rejected by Rspamd for various reasons, this custom configuration override can be added:

/etc/nixos/configuration.nix
services.rspamd = {
  enable = true;
  overrides."whitelist.conf".text = ''
    whitelist_from {
      example.org = true;
    }
  '';
};

DKIM key

This module verifies the authenticity of emails through the analysis of DKIM signatures. In this example, we're configure a custom DKIM key file path suitable for the mailserver Maddy and adjust the group permissions for the Rspamd service.

/etc/nixos/configuration.nix
services.rspamd = {
  enable = true;
  locals."dkim_signing.conf".text = ''
    selector = "default";
    path = "/var/lib/maddy/dkim_keys/$domain_$selector.key";
  '';
};

systemd.services.rspamd.serviceConfig.SupplementaryGroups = [ "maddy" ];