]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Allow to register idempotent filters from Lua
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 12 Aug 2017 15:44:40 +0000 (16:44 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 12 Aug 2017 19:26:17 +0000 (20:26 +0100)
src/lua/lua_config.c

index 79dd11e762f892e5710bd5988cac2a0d4e79297c..21cc4bbe7c74c92e49776111fbd83fdcd4769f5f 100644 (file)
@@ -1405,6 +1405,9 @@ lua_parse_symbol_flags (const gchar *str)
                if (strstr (str, "nostat") != NULL) {
                        ret |= SYMBOL_TYPE_NOSTAT;
                }
+               if (strstr (str, "idempotent") != NULL) {
+                       ret |= SYMBOL_TYPE_IDEMPOTENT;
+               }
        }
 
        return ret;
@@ -1436,6 +1439,9 @@ lua_parse_symbol_type (const gchar *str)
                                        ret = SYMBOL_TYPE_PREFILTER | SYMBOL_TYPE_GHOST;
                                } else if (g_ascii_strcasecmp (str, "postfilter") == 0) {
                                        ret = SYMBOL_TYPE_POSTFILTER | SYMBOL_TYPE_GHOST;
+                               } else if (g_ascii_strcasecmp (str, "idempotent") == 0) {
+                                       ret = SYMBOL_TYPE_POSTFILTER | SYMBOL_TYPE_GHOST |
+                                                       SYMBOL_TYPE_IDEMPOTENT;
                                } else {
                                        gint fl = 0;