[Rspamd-Users] set_metric_action?

Manuel Garbin manuel at studiostorti.com
Wed Nov 21 08:46:59 UTC 2018


Hi 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


More information about the Users mailing list