struct metric_result {
struct metric *metric; /**< pointer to metric structure */
double score; /**< total score */
+ enum rspamd_metric_action action; /**< the current action */
GHashTable *symbols; /**< symbols of metric */
gboolean checked; /**< whether metric result is consolidated */
double grow_factor; /**< current grow factor */
m = mres->metric;
/* XXX: handle settings */
- action = rspamd_check_action_metric (task, mres->score, &required_score, m);
+ if (mres->action == METRIC_ACTION_MAX) {
+ mres->action = rspamd_check_action_metric (task, mres->score,
+ &required_score, m);
+ }
+ else {
+ required_score = mres->metric->actions[mres->action].score;
+ }
+ action = mres->action;
is_spam = (action == METRIC_ACTION_REJECT);
+
if (task->is_skipped) {
action_char = 'S';
}
else {
action_char = 'F';
}
+
rspamd_printf_gstring (logbuf, "(%s: %c (%s): [%.2f/%.2f] [",
m->name, action_char,
rspamd_action_to_str (action),
rspamd_http_message_add_header (msg, hn->str, hv->str);
}
-
g_hash_table_iter_init (&hiter, task->results);
top = ucl_object_typed_new (UCL_OBJECT);
mres = rspamd_create_metric_result (task, DEFAULT_METRIC);
if (mres != NULL) {
mres->score = mres->metric->actions[action].score;
+ mres->action = action;
}
task->pre_result.action = action;
if (lua_gettop (L) >= 3) {