Rspamd: Difference between revisions

Onny (talk | contribs)
Remove unstable notice
Ser (talk | contribs)
configuration of secrets
 
(One intermediate revision by one other user not shown)
Line 7: Line 7:
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
services.rspamd.enable = true;
services.rspamd.enable = true;
</nowiki>}}
To use Rspamd with Postfix add
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
services.rspamd.postfix.enable = true;
</nowiki>}}
</nowiki>}}


Line 68: Line 74:


systemd.services.rspamd.serviceConfig.SupplementaryGroups = [ "maddy" ];
systemd.services.rspamd.serviceConfig.SupplementaryGroups = [ "maddy" ];
</nowiki>}}
=== Secrets ===
Sometimes you need to provide secrets which should not be kept in the public store. In this example we add an API key to GPT module. You need to have the file with a name for example `ai.conf` with content:
{{file|/var/spool/keys/ai.conf|nix|<nowiki>
api_key = "your_secret_key";
</nowiki>}}
and prepare your GPT configuration - in this example it's only part of it, consult the GPT module documentation.
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
services.rspamd = {
  overrides = {
    "gpt.conf".text = ''
      enabled = true;
      #api_key = ""; # API KEY IN SECRETS!!!
      .include(try=true; priority=10,duplicate=merge) "/var/spool/keys/ai.conf"
      autolearn = true;
    '';
  };
};
</nowiki>}}
</nowiki>}}