diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-09-04 14:32:32 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-09-04 14:32:32 +0100 |
commit | d4f37febf7793c0b2b328203f1f85ab51b8fe8ad (patch) | |
tree | 6dde1ea1c4e130edd8dfbf79df3044f742a5be51 /src/plugins | |
parent | 3f78f1f7213afded0029efcf439556c628971b17 (diff) | |
download | rspamd-d4f37febf7793c0b2b328203f1f85ab51b8fe8ad.tar.gz rspamd-d4f37febf7793c0b2b328203f1f85ab51b8fe8ad.zip |
Fix case of SURBL symbols.
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/surbl.c | 9 | ||||
-rw-r--r-- | src/plugins/surbl.h | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c index a20829156..3f0d873d8 100644 --- a/src/plugins/surbl.c +++ b/src/plugins/surbl.c @@ -476,6 +476,8 @@ surbl_module_config (struct rspamd_config *cfg) ucl_iterate_object (cur, &it, true)) != NULL) { if (ucl_object_key (cur_bit) != NULL && cur_bit->type == UCL_INT) { + gchar *p; + bit = ucl_obj_toint (cur_bit); new_bit = rspamd_mempool_alloc ( surbl_module_ctx->surbl_pool, @@ -484,6 +486,13 @@ surbl_module_config (struct rspamd_config *cfg) new_bit->symbol = rspamd_mempool_strdup ( surbl_module_ctx->surbl_pool, ucl_object_key (cur_bit)); + /* Convert to uppercase */ + p = new_bit->symbol; + while (*p) { + *p = g_ascii_toupper (*p); + p ++; + } + msg_debug ("add new bit suffix: %d with symbol: %s", (gint)new_bit->bit, new_bit->symbol); new_suffix->bits = g_list_prepend (new_suffix->bits, diff --git a/src/plugins/surbl.h b/src/plugins/surbl.h index 912e7fb11..1c97c2a4d 100644 --- a/src/plugins/surbl.h +++ b/src/plugins/surbl.h @@ -78,7 +78,7 @@ struct redirector_param { struct surbl_bit_item { guint32 bit; - const gchar *symbol; + gchar *symbol; }; #endif |