SET_START_BIT (checkpoint, dyn_item);
if (!item->enabled ||
- (RSPAMD_TASK_IS_EMPTY (task) && !(item->type & SYMBOL_TYPE_EMPTY))) {
+ (RSPAMD_TASK_IS_EMPTY (task) && !(item->type & SYMBOL_TYPE_EMPTY)) ||
+ (item->type & SYMBOL_TYPE_MIME_ONLY && !RSPAMD_TASK_IS_MIME(task))) {
check = FALSE;
}
else if (item->specific.normal.condition_cb != -1) {
SYMBOL_TYPE_IDEMPOTENT = (1 << 12), /* Symbol cannot change metric */
SYMBOL_TYPE_SQUEEZED = (1 << 13), /* Symbol is squeezed inside Lua */
SYMBOL_TYPE_TRIVIAL = (1 << 14), /* Symbol is trivial */
+ SYMBOL_TYPE_MIME_ONLY = (1 << 15), /* Symbol is mime only */
};
/**
#define RSPAMD_TASK_IS_CLASSIFIED(task) (((task)->processed_stages & RSPAMD_TASK_STAGE_CLASSIFIERS))
#define RSPAMD_TASK_IS_EMPTY(task) (((task)->flags & RSPAMD_TASK_FLAG_EMPTY))
#define RSPAMD_TASK_IS_PROFILING(task) (((task)->flags & RSPAMD_TASK_FLAG_PROFILE))
+#define RSPAMD_TASK_IS_MIME(task) (((task)->flags & RSPAMD_TASK_FLAG_MIME))
struct rspamd_email_address;
struct rspamd_lang_detector;
if (strstr (str, "trivial") != NULL) {
ret |= SYMBOL_TYPE_TRIVIAL;
}
+ if (strstr (str, "mime") != NULL) {
+ ret |= SYMBOL_TYPE_MIME_ONLY;
+ }
}
return ret;