[Rspamd-Users] What's wrong with this?

G.W. Haywood rspamd at jubileegroup.co.uk
Wed Feb 8 18:22:20 UTC 2023


Hi there,

On Wed, 8 Feb 2023, Steve Witten wrote:

> I'm trying my hand at writing a simple custom rule.  I basically copy
> pasted this from the manual into *local.d/headers_group.conf*:
>
> rspamd_config.SW_MY_RULE = {
>>      callback = function(task)
>>          return true
>>      end,
>>      score = 3.0,
>>      group = 'headers',
>>      description = 'My description'
>> }
>
>
> I get the following when I reload *rspamd*:
>
>> *stevewi: $*
>> *sudo service rspamd reload*Performing sanity check on rspamd
>> configuration:
>> failed to load config: ucl parser error: error while parsing
>> /srv/rspamd/etc/rspamd/local.d/headers_group.conf: line: 4, column: 8 -
>> 'invalid character in a key', character: ','
>> syntax BAD
>
>
> I'm very new at Lua but I just don't see a mistake...  I've checked all the
> line endings.  The rule compiles without the callback.
>
> Can anyone point out the mistake?  Thanks in advance...

*Assuming* that line 4 column 8 is the comma after the 'end', then at
a guess (I didn't test) you might need to put some statement in the
callback which actually does something before it returns a value.

-- 

73,
Ged.


More information about the Users mailing list