]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Set required_score = reject score and minor change to the report 4383/head
authorAmish <3330468+amishmm@users.noreply.github.com>
Thu, 26 Jan 2023 10:24:27 +0000 (15:54 +0530)
committerAmish <3330468+amishmm@users.noreply.github.com>
Thu, 26 Jan 2023 10:24:27 +0000 (15:54 +0530)
src/client/rspamc.cxx

index fc1ba0cc1a8bcb424e5f042bbd441ea53cfd5c47..47362a5e32b41867236e5c51bcd1cb4c4b71e7d2 100644 (file)
@@ -971,14 +971,19 @@ rspamc_metric_output(FILE *out, const ucl_object_t *obj)
        const auto *thresholds_obj = ucl_object_lookup(obj, "thresholds");
 
        if (thresholds_obj && ucl_object_type(thresholds_obj) == UCL_OBJECT) {
-               const auto *greylist_obj = ucl_object_lookup(thresholds_obj, "greylist");
-               if (greylist_obj) {
-                       greylist_score = ucl_object_todouble(greylist_obj);
+               const auto *action_obj = ucl_object_lookup(thresholds_obj, "greylist");
+               if (action_obj) {
+                       greylist_score = ucl_object_todouble(action_obj);
                }
 
-               const auto *add_header_obj = ucl_object_lookup(thresholds_obj, "add header");
-               if (add_header_obj) {
-                       addheader_score = ucl_object_todouble(add_header_obj);
+               action_obj = ucl_object_lookup(thresholds_obj, "add header");
+               if (action_obj) {
+                       addheader_score = ucl_object_todouble(action_obj);
+               }
+
+               action_obj = ucl_object_lookup(thresholds_obj, "reject");
+               if (action_obj) {
+                       required_score = ucl_object_todouble(action_obj);
                }
        }
 
@@ -1075,7 +1080,7 @@ rspamc_metric_output(FILE *out, const ucl_object_t *obj)
        if (humanreport) {
                fmt::print(out, "Content analysis details:   ({} points, {} required)\n\n",
                        emphasis_argument(score, 2),
-                       emphasis_argument(required_score, 2));
+                       emphasis_argument(addheader_score, 2));
                fmt::print(out, " pts rule name              description\n");
                fmt::print(out, "---- ---------------------- --------------------------------------------------\n");
        }