summaryrefslogtreecommitdiffstats
path: root/src/lua/lua_config.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-01-07 16:08:37 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-01-07 16:08:37 +0000
commit7b6227cfaa3b5b4273e6841c8d5811514fff28e2 (patch)
tree94e627051278d5e77cb45efb8052691465729a03 /src/lua/lua_config.c
parent6e436ccc95d024f11bec5391678edef1f90b609a (diff)
downloadrspamd-7b6227cfaa3b5b4273e6841c8d5811514fff28e2.tar.gz
rspamd-7b6227cfaa3b5b4273e6841c8d5811514fff28e2.zip
[Minor] Core: Allow to pass flags to squeezed rules
Diffstat (limited to 'src/lua/lua_config.c')
-rw-r--r--src/lua/lua_config.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c
index cc0ba7aed..31d4af79b 100644
--- a/src/lua/lua_config.c
+++ b/src/lua/lua_config.c
@@ -1278,8 +1278,27 @@ rspamd_register_symbol_fromlua (lua_State *L,
/* Push function reference */
lua_rawgeti (L, LUA_REGISTRYINDEX, ref);
+ /* Flags */
+ lua_createtable (L, 0, 0);
+
+ if (type & SYMBOL_TYPE_MIME_ONLY) {
+ lua_pushstring (L, "mime");
+ lua_pushboolean (L, true);
+ lua_settable (L, -3);
+ }
+ if (type & SYMBOL_TYPE_FINE) {
+ lua_pushstring (L, "fine");
+ lua_pushboolean (L, true);
+ lua_settable (L, -3);
+ }
+ if (type & SYMBOL_TYPE_NOSTAT) {
+ lua_pushstring (L, "nostat");
+ lua_pushboolean (L, true);
+ lua_settable (L, -3);
+ }
+
/* Now call for squeeze function */
- if (lua_pcall (L, 2, 1, err_idx) != 0) {
+ if (lua_pcall (L, 3, 1, err_idx) != 0) {
GString *tb = lua_touserdata (L, -1);
msg_err_config ("call to squeeze_rule failed: %v", tb);