case EVENT_FIELD_VALUE_TYPE_STRLIST:
/* check if the value is (or is not) on the list,
only string matching makes sense here. */
- if (node->op != EVENT_FILTER_OP_CMP_EQ)
+ if (node->op != EVENT_FILTER_OP_CMP_EQ) {
+ if (!node->warned_string_inequality) {
+ const char *name = event->sending_name;
+ i_warning("Event filter for string list field "
+ "'%s' only supports equality "
+ "operation '=' not '%s'. (event=%s, "
+ "source=%s:%u)",
+ wanted_field->key,
+ event_filter_export_query_expr_op(node->op),
+ name != NULL ? name : "",
+ source_filename, source_linenum);
+ node->warned_string_inequality = TRUE;
+ }
return FALSE;
+ }
return event_match_strlist(event, wanted_field, use_strcmp);
}
i_unreached();
test_assert(event_filter_match(filter, e, &failure_ctx));
event_filter_unref(&filter);
+ filter = event_filter_create();
+ event_filter_parse("abc>one", filter, NULL);
+ test_expect_error_string("Event filter for string field 'abc' only "
+ "supports equality operation '=' not '>'.");
+ test_assert(!event_filter_match(filter, e, &failure_ctx));
+ test_expect_no_more_errors();
+ event_filter_unref(&filter);
+
event_unref(&e);
test_end();
}