[Rspamd-Users] set_metric_action?

Aki Kyo aki.2kyo at gmail.com
Wed Nov 21 21:41:01 UTC 2018


Hi Manuel! Thank you for helping, thank you for tracking it.

The arguments have changed since version 1.6 (before two string
arguments), and the function was removed from the documentation so you
have taught me about the change.

I want to test the new version but there is no information what a
score means when applied to an action. Scores are suppose to be for
symbols. Now I must score the action? This is difficult to understand.

Also what do I put for the "priority"?? The type is "priority"??

If no one can answer these questions, could you help me find hints in the code?

Very kind for you to offer your expertise!
-Aki

> if you can see here
> https://github.com/rspamd/rspamd/blob/master/src/lua/lua_config.c the
> function is still active.
> Is reported as set_action :
>
> /**
>  * @method rspamd_config:set_action({table})
>  * Sets the score of a specified action in a metric. This function accepts
> table with the following elements:
>  *
>  * - `action`: name of action (string)
>  * - `score`: score for action (number)
>  * - `metric`: name of metric (string, optional)
>  * - `priority`: priority of action's definition
>  */
>
> You need to pass a table to the function, have you see if the value that you
> are passing to the function is not nil value?
>
> ----- Messaggio originale -----
> Da: "Aki Kyo" <aki.2kyo at gmail.com>
> A: "users at lists.rspamd.com" <users at lists.rspamd.com>
> Inviato: Martedì, 20 novembre 2018 23:17:18
> Oggetto: Re: [Rspamd-Users] set_metric_action?
>
> Please help? Without task:set_metric_action() rspamd custom Lua
> postfilter script is crippled, how can we bring this back?
>
>
> On 11/17/18, Aki Kyo <aki.2kyo at gmail.com> wrote:
>> hi, I was using task:set_metric_action in a custom post-filter lua script:
>>
>> task:set_metric_action('', 'add header')
>>
>> the reason to use it is complex, force_action module could not
>> suffice. In recent rspamd release, is set_metric_action deprecated? It
>> has gone missing from Lua Task documentation page:
>>
>> https://www.rspamd.com/doc/lua/rspamd_task.html
>>
>> also it's broken:
>>
>> task; lua_metric_symbol_callback_error: call to (my_postfilter_script)
>> failed (2): /etc/rspamd/rspamd.local.lua:143: attempt to call method
>> 'set_metric_action' (a nil value);
>>
>> What's the new way to do this?
>>
> --
> Users mailing list
> Users at lists.rspamd.com
> https://lists.rspamd.com/mailman/listinfo/users
> --
> Users mailing list
> Users at lists.rspamd.com
> https://lists.rspamd.com/mailman/listinfo/users
>


More information about the Users mailing list