diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-05-05 19:07:38 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-05-05 19:07:38 +0100 |
commit | 836939f0cce79dbcd14338982dabc632dcc0928f (patch) | |
tree | 31db21f8900516c516e65b743812713c2eb388a6 /src | |
parent | 53282bc59b9c7252c2a8e559f9fbbe801f913840 (diff) | |
download | rspamd-836939f0cce79dbcd14338982dabc632dcc0928f.tar.gz rspamd-836939f0cce79dbcd14338982dabc632dcc0928f.zip |
Implement group composites.
Diffstat (limited to 'src')
-rw-r--r-- | src/libmime/filter.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/libmime/filter.c b/src/libmime/filter.c index ed5b2ec8f..e8e27d3cf 100644 --- a/src/libmime/filter.c +++ b/src/libmime/filter.c @@ -32,6 +32,7 @@ #include "expression.h" #include "diff.h" #include "libstat/stat_api.h" +#include "utlist.h" #ifdef WITH_LUA # include "lua/lua_common.h" @@ -525,6 +526,8 @@ rspamd_composite_expr_process (gpointer input, rspamd_expression_atom_t *atom) const gchar *sym = atom->data; struct symbol_remove_data *rd; struct symbol *ms; + struct rspamd_symbols_group *gr; + struct rspamd_symbol_def *sdef; gint rc = 0; gchar t = '\0'; @@ -538,7 +541,21 @@ rspamd_composite_expr_process (gpointer input, rspamd_expression_atom_t *atom) t = *sym ++; } - rc = rspamd_composite_process_single_symbol (cd, sym, &ms); + if (strncmp (sym, "g:", 2) == 0) { + gr = g_hash_table_lookup (cd->task->cfg->symbols_groups, sym + 2); + + if (gr != NULL) { + LL_FOREACH (gr->symbols, sdef) { + rc = rspamd_composite_process_single_symbol (cd, sdef->name, &ms); + if (rc) { + break; + } + } + } + } + else { + rc = rspamd_composite_process_single_symbol (cd, sym, &ms); + } if (rc && ms) { /* |