diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-05-15 14:21:41 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-05-15 14:21:41 +0100 |
commit | f57c6e2c50e05aebbc9020fc9fe58b647b15b9dd (patch) | |
tree | 53f4d90ce06efaabf776586bdd8e038744b33a5f /src/plugins/regexp.c | |
parent | 1d2cb297a1cd882e6b0ea75ca5c081f844742c18 (diff) | |
download | rspamd-f57c6e2c50e05aebbc9020fc9fe58b647b15b9dd.tar.gz rspamd-f57c6e2c50e05aebbc9020fc9fe58b647b15b9dd.zip |
[Feature] Allow multiple groups for symbols
Diffstat (limited to 'src/plugins/regexp.c')
-rw-r--r-- | src/plugins/regexp.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c index 03dd21734..57b8e524e 100644 --- a/src/plugins/regexp.c +++ b/src/plugins/regexp.c @@ -305,6 +305,22 @@ regexp_module_config (struct rspamd_config *cfg) rspamd_config_add_symbol (cfg, cur_item->symbol, score, description, group, flags, priority, nshots); + + elt = ucl_object_lookup (value, "groups"); + + if (elt) { + ucl_object_iter_t gr_it; + const ucl_object_t *cur_gr; + + gr_it = ucl_object_iterate_new (elt); + + while ((cur_gr = ucl_object_iterate_safe (gr_it, true)) != NULL) { + rspamd_config_add_symbol_group (cfg, cur_item->symbol, + ucl_object_tostring (cur_gr)); + } + + ucl_object_iterate_free (gr_it); + } } } else { |