]> source.dussan.org Git - rspamd.git/commitdiff
Fix settings using.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 11 May 2011 16:55:02 +0000 (20:55 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 11 May 2011 16:55:02 +0000 (20:55 +0400)
Revert genmodules logic.

lib/CMakeLists.txt
src/message.c
src/settings.c

index 2fdf379047979bcb907e32ea4a8d80f54e1cb08b..2bb4e028ee60ad81c355c0ac0f9874a243729d54 100644 (file)
@@ -64,9 +64,4 @@ SET_TARGET_PROPERTIES(rspamdserver PROPERTIES LINKER_LANGUAGE C)
 SET_TARGET_PROPERTIES(rspamdserver PROPERTIES COMPILE_FLAGS "-DRSPAMD_LIB")
 TARGET_LINK_LIBRARIES(rspamdserver rspamd_lua)
 TARGET_LINK_LIBRARIES(rspamdserver rspamd_json)
-TARGET_LINK_LIBRARIES(rspamdserver rspamd_cdb)   
-
-ADD_CUSTOM_TARGET(genmodules
-                                       COMMAND ../utils/gen-modules.sh ${PLUGINSSRC}
-                                       WORKING_DIRECTORY src)   
-ADD_DEPENDENCIES(rspamdserver genmodules)
\ No newline at end of file
+TARGET_LINK_LIBRARIES(rspamdserver rspamd_cdb)   
\ No newline at end of file
index ab2e41206ad0b2d4b33df0cd6a7fe5697f2d4abf..4f8d4dcc3e9d07f0ed535603e5db0313b29c53d9 100644 (file)
@@ -28,7 +28,6 @@
 #include "message.h"
 #include "cfg_file.h"
 #include "html.h"
-#include "modules.h"
 #include "images.h"
 
 #define RECURSION_LIMIT 30
index 8d18880a0b7a86dce4250b7524d9193f580ae0d8..8c13681ef42fefe54f504986a8cad07f7bcd9595 100644 (file)
@@ -329,6 +329,8 @@ static                          gboolean
 check_setting (struct worker_task *task, struct rspamd_settings **user_settings, struct rspamd_settings **domain_settings)
 {
        gchar                           *field = NULL, *domain = NULL;
+       gchar                            cmp_buf[1024];
+       gint                             len;
 
        if (task->deliver_to != NULL) {
                /* First try to use deliver-to field */
@@ -359,10 +361,17 @@ check_setting (struct worker_task *task, struct rspamd_settings **user_settings,
 
        /* First try to search per-user settings */
        if (field != NULL) {
-               *user_settings = g_hash_table_lookup (task->cfg->user_settings, field);
+               if (*field == '<') {
+                       field ++;
+               }
+               len = strcspn (field, ">");
+               rspamd_strlcpy (cmp_buf, field, MIN (sizeof (cmp_buf), len + 1));
+               *user_settings = g_hash_table_lookup (task->cfg->user_settings, cmp_buf);
        }
        if (domain != NULL) {
-               *domain_settings = g_hash_table_lookup (task->cfg->domain_settings, domain);
+               len = strcspn (domain, ">");
+               rspamd_strlcpy (cmp_buf, domain, MIN (sizeof (cmp_buf), len + 1));
+               *domain_settings = g_hash_table_lookup (task->cfg->domain_settings, cmp_buf);
        }
 
        if (*domain_settings != NULL || *user_settings != NULL) {