return ret;
}
-static struct rspamd_action_config *
+struct rspamd_action_config *
rspamd_find_action_config_for_action (struct rspamd_scan_result *scan_result,
struct rspamd_action *act)
{
struct rspamd_passthrough_result **ppr,
struct rspamd_scan_result *scan_result);
+struct rspamd_action_config *rspamd_find_action_config_for_action (struct rspamd_scan_result *scan_result,
+ struct rspamd_action *act);
+
#ifdef __cplusplus
}
#endif
#include "libutil/cxx/util.hxx"
#include "libserver/task.h"
#include "libmime/scan_result.h"
+#include "utlist.h"
#include "libserver/worker_util.h"
#include <limits>
#include <cmath>
}
}
+ if (task->result->passthrough_result != nullptr) {
+ /* We also need to check passthrough results */
+ auto *pr = task->result->passthrough_result;
+ DL_FOREACH (task->result->passthrough_result, pr) {
+ struct rspamd_action_config *act_config =
+ rspamd_find_action_config_for_action(task->result, pr->action);
+
+ /* Skip least results */
+ if (pr->flags & RSPAMD_PASSTHROUGH_LEAST) {
+ continue;
+ }
+
+ /* Skip disabled actions */
+ if (act_config && (act_config->flags & RSPAMD_ACTION_RESULT_DISABLED)) {
+ continue;
+ }
+
+ /* Immediately stop on non least passthrough action */
+ return true;
+ }
+ }
+
return false;
}