summaryrefslogtreecommitdiffstats
path: root/src/libmime
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-08-18 15:43:17 -0700
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-08-18 15:43:17 -0700
commit2323c30e8ee4ac54331cb9e3dd56060254626655 (patch)
tree72002c5f9c69e2c1248edcb01fb61419ab88d973 /src/libmime
parent12a910a0933681620bd07809ec8045ae63ae6c0b (diff)
downloadrspamd-2323c30e8ee4ac54331cb9e3dd56060254626655.tar.gz
rspamd-2323c30e8ee4ac54331cb9e3dd56060254626655.zip
Properly find 'actions' property.
Diffstat (limited to 'src/libmime')
-rw-r--r--src/libmime/filter.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/libmime/filter.c b/src/libmime/filter.c
index ead59c4bf..f340b9dbc 100644
--- a/src/libmime/filter.c
+++ b/src/libmime/filter.c
@@ -255,7 +255,7 @@ static gboolean
check_metric_settings (struct rspamd_task *task, struct metric *metric,
double *score)
{
- const ucl_object_t *mobj, *reject;
+ const ucl_object_t *mobj, *reject, *act;
double val;
if (task->settings == NULL) {
@@ -264,11 +264,14 @@ check_metric_settings (struct rspamd_task *task, struct metric *metric,
mobj = ucl_object_find_key (task->settings, metric->name);
if (mobj != NULL) {
- reject = ucl_object_find_key (mobj,
- str_action_metric (METRIC_ACTION_REJECT));
- if (reject != NULL && ucl_object_todouble_safe (reject, &val)) {
- *score = val;
- return TRUE;
+ act = ucl_object_find_key (mobj, "actions");
+ if (act != NULL) {
+ reject = ucl_object_find_key (act,
+ str_action_metric (METRIC_ACTION_REJECT));
+ if (reject != NULL && ucl_object_todouble_safe (reject, &val)) {
+ *score = val;
+ return TRUE;
+ }
}
}