mirror of
https://gitlab.com/simple-nixos-mailserver/nixos-mailserver.git
synced 2024-12-26 03:00:33 +05:00
Wrap rspamc to avoid having to specific socket manually
This commit is contained in:
parent
059b50b2e7
commit
af7d3bf5da
@ -24,17 +24,14 @@ You can run the training in a root shell as follows:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
# Path to the controller socket
|
||||
export RSOCK="/var/run/rspamd/worker-controller.sock"
|
||||
|
||||
# Learn the Junk folder as spam
|
||||
rspamc -h $RSOCK learn_spam /var/vmail/$DOMAIN/$USER/.Junk/cur/
|
||||
rspamc learn_spam /var/vmail/$DOMAIN/$USER/.Junk/cur/
|
||||
|
||||
# Learn the INBOX as ham
|
||||
rspamc -h $RSOCK learn_ham /var/vmail/$DOMAIN/$USER/cur/
|
||||
rspamc learn_ham /var/vmail/$DOMAIN/$USER/cur/
|
||||
|
||||
# Check that training was successful
|
||||
rspamc -h $RSOCK stat | grep learned
|
||||
rspamc stat | grep learned
|
||||
|
||||
Tune symbol weight
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
@ -25,6 +25,15 @@ let
|
||||
in
|
||||
{
|
||||
config = with cfg; lib.mkIf enable {
|
||||
environment.systemPackages = lib.mkBefore [
|
||||
(pkgs.runCommand "rspamc-wrapped" {
|
||||
nativeBuildInputs = with pkgs; [ makeWrapper ];
|
||||
}''
|
||||
makeWrapper ${pkgs.rspamd}/bin/rspamc $out/bin/rspamc \
|
||||
--add-flags "-h /var/run/rspamd/worker-controller.sock"
|
||||
'')
|
||||
];
|
||||
|
||||
services.rspamd = {
|
||||
enable = true;
|
||||
inherit debug;
|
||||
|
Loading…
Reference in New Issue
Block a user