gboolean ignore_received; /**< Ignore data from the first received header */
gboolean enable_sessions_cache; /**< Enable session cache for debug */
gboolean enable_experimental; /**< Enable experimental plugins */
- gboolean disable_pcre_jit; /**< Disable pcre JIT */
+ gboolean disable_pcre_jit; /**< Disable pcre JIT */
+ gboolean disable_lua_squeeze; /**< Disable lua rules squeezing */
gsize max_diff; /**< maximum diff size for text parts */
gsize max_cores_size; /**< maximum size occupied by rspamd core files */
0,
"Enable experimental plugins");
rspamd_rcl_add_default_handler (sub,
- "enable_experimental",
+ "disable_pcre_jit",
rspamd_rcl_parse_struct_boolean,
G_STRUCT_OFFSET (struct rspamd_config, disable_pcre_jit),
0,
"Disable PCRE JIT");
+ rspamd_rcl_add_default_handler (sub,
+ "disable_lua_squeeze",
+ rspamd_rcl_parse_struct_boolean,
+ G_STRUCT_OFFSET (struct rspamd_config, disable_lua_squeeze),
+ 0,
+ "Disable Lua rules squeezing");
rspamd_rcl_add_default_handler (sub,
"all_filters",
rspamd_rcl_parse_struct_boolean,
return luaL_error (L, "invalid arguments");
}
+ if (!no_squeeze) {
+ no_squeeze = cfg->disable_lua_squeeze;
+ }
+
if (nshots == 0) {
nshots = cfg->default_max_shots;
}
struct rspamd_config *cfg = lua_check_config (L, 1);
const gchar *parent = NULL, *child = NULL;
gint child_id;
- gboolean skip_squeeze = FALSE;
+ gboolean skip_squeeze;
if (cfg == NULL) {
lua_error (L);
return 0;
}
+ skip_squeeze = cfg->disable_lua_squeeze;
+
if (lua_type (L, 2) == LUA_TNUMBER) {
child_id = luaL_checknumber (L, 2);
parent = luaL_checkstring (L, 3);
- if (lua_isboolean (L, 4)) {
+ if (!skip_squeeze && lua_isboolean (L, 4)) {
skip_squeeze = lua_toboolean (L, 4);
}
child = luaL_checkstring (L,2);
parent = luaL_checkstring (L, 3);
- if (lua_isboolean (L, 4)) {
+ if (!skip_squeeze && lua_isboolean (L, 4)) {
skip_squeeze = lua_toboolean (L, 4);
}
name = luaL_checkstring (L, 2);
if (cfg != NULL && name != NULL && lua_gettop (L) == 3) {
+ no_squeeze = cfg->disable_lua_squeeze;
+
if (lua_type (L, 3) == LUA_TFUNCTION) {
/* Normal symbol from just a function */
lua_pushvalue (L, 3);
const char *type_str, *group = NULL, *description = NULL;
guint flags = 0;
+ no_squeeze = cfg->disable_lua_squeeze;
/*
* Table can have the following attributes:
* "callback" - should be a callback function
}
lua_pop (L, 1);
- lua_pushstring (L, "no_squeeze");
- lua_gettable (L, -2);
+ if (!no_squeeze) {
+ lua_pushstring (L, "no_squeeze");
+ lua_gettable (L, -2);
- if (lua_toboolean (L, -1)) {
- no_squeeze = TRUE;
+ if (lua_toboolean (L, -1)) {
+ no_squeeze = TRUE;
+ }
+ lua_pop (L, 1);
}
- lua_pop (L, 1);
id = rspamd_register_symbol_fromlua (L,
cfg,