spamhaus / rspamd-dqs

Spamhaus code for RSPAMD Plugin. See https://docs.spamhaustech.com/40-real-world-usage/Rspamd/000-intro.html for instructions
Apache License 2.0
61 stars 11 forks source link

Possible configuration problem in readme #19

Closed ahmeij closed 2 years ago

ahmeij commented 2 years ago

The command to copy all files to the rspamd folder as specified in the readme: cp *.conf rspamd.local.lua /etc/rspamd/local.d

Seems to conflict with the needed configuration for Rspamd which expects the rspamd.local.lua to be in the /etc/rspamd folder.

As far as I can tell the file will not be loaded from the /etc/rspamd/local.d folder, it is ignored by the rspamadm configtest at least.

ricalfieri commented 2 years ago

Hi,

you are correct! Thanks for noticing the error. I updated the README

whataboutpereira commented 2 years ago

I think I personally put the LUA file in local.d, but symlinked it to /etc/rspamd. This way all the customisation is in the same location.

GwynethLlewelyn commented 2 years ago

I'm confused now. The README still shows cp *.conf rspamd.local.lua /etc/rspamd/local.d. Is rspamd.local.lua to be placed in /etc/rspamd/ (or symlinked from there) or not?

Note that other providers using similar anti-spam measures also place their own .lua files under /etc/rspamd/...

reinob commented 2 years ago

from what I can see in /usr/share/rspamd/rspamd.lua it will try to run /etc/rspamd/rspamd.local.lua OR (legacy, only if the other file does not exist) /etc/rspamd/lua/rspamd.local.lua.

Also, /etc/rspamd/local.d/rspamd.lua will be run, if found.

So as it is, the rspamd.local.lua should be copied to /etc/rspamd. If other programs require you to also place a rspamd.local.lua there, then I (personally) would just merge both files into one, as currently rspamd does not seem to allow for running all lua files found in a certain directory.

(or you could make on rspamd.local.lua which calls dofile(file1.lua), dofile(file2.lua), etc.). In the end what matters is that the code is somehow executed during initialization of rspamd.

GwynethLlewelyn commented 2 years ago

Aye, I've followed your suggestion, and merged both, keeping them in /etc/rspamd.

This should actually be something worth documenting!