From: Vsevolod Stakhov Date: Thu, 4 Sep 2014 13:32:32 +0000 (+0100) Subject: Fix case of SURBL symbols. X-Git-Tag: 0.7.0~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4f37febf7793c0b2b328203f1f85ab51b8fe8ad;p=thirdparty%2Frspamd.git Fix case of SURBL symbols. --- diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c index a208291563..3f0d873d85 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 912e7fb110..1c97c2a4d2 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