aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_util.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-07-14 17:33:31 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-07-14 17:33:31 +0100
commit02b6117a397bb5cba27ca63a7e2df1c5dbfd0125 (patch)
tree14bab1422a7d4eec4a6d2040b3d93f82f38c47f0 /src/lua/lua_util.c
parent828c31c52830e4a78da94d66c2ce8936380633e2 (diff)
downloadrspamd-02b6117a397bb5cba27ca63a7e2df1c5dbfd0125.tar.gz
rspamd-02b6117a397bb5cba27ca63a7e2df1c5dbfd0125.zip
Implement skipping of signatures in text messages.
Diffstat (limited to 'src/lua/lua_util.c')
-rw-r--r--src/lua/lua_util.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lua/lua_util.c b/src/lua/lua_util.c
index 9a670da04..8d5686f7c 100644
--- a/src/lua/lua_util.c
+++ b/src/lua/lua_util.c
@@ -340,7 +340,7 @@ lua_util_tokenize_text (lua_State *L)
struct process_exception *ex;
GArray *res;
rspamd_fstring_t *w;
- gboolean compat = FALSE;
+ gboolean compat = FALSE, check_sig = FALSE;
if (lua_type (L, 1) == LUA_TSTRING) {
in = luaL_checklstring (L, 1, &len);
@@ -389,11 +389,16 @@ lua_util_tokenize_text (lua_State *L)
compat = lua_toboolean (L, 3);
}
+ if (lua_gettop (L) > 3 && lua_type (L, 4) == LUA_TBOOLEAN) {
+ check_sig = lua_toboolean (L, 4);
+ }
+
if (exceptions) {
exceptions = g_list_reverse (exceptions);
}
- res = rspamd_tokenize_text ((gchar *)in, len, TRUE, 0, exceptions, compat);
+ res = rspamd_tokenize_text ((gchar *)in, len, TRUE, 0, exceptions, compat,
+ check_sig);
if (res == NULL) {
lua_pushnil (L);