summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-10-03 15:48:49 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-10-03 15:48:49 +0100
commit51b4e9df7df20558bc8dd95170bdf228ec79bf62 (patch)
tree2eb3dc5ff85d66e41e24df5bd48367a2911bd347 /src
parent727326ae53e9ca72857c0dfc29753757ba72b170 (diff)
downloadrspamd-51b4e9df7df20558bc8dd95170bdf228ec79bf62.tar.gz
rspamd-51b4e9df7df20558bc8dd95170bdf228ec79bf62.zip
Fix dkim_check plugin.
Diffstat (limited to 'src')
-rw-r--r--src/plugins/dkim_check.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/plugins/dkim_check.c b/src/plugins/dkim_check.c
index a1a022665..3872030cd 100644
--- a/src/plugins/dkim_check.c
+++ b/src/plugins/dkim_check.c
@@ -114,7 +114,7 @@ dkim_module_init (struct config_file *cfg, struct module_ctx **ctx)
gint
dkim_module_config (struct config_file *cfg)
{
- gchar *value;
+ rspamd_cl_object_t *value;
gint res = TRUE;
guint cache_size, cache_expire;
gboolean got_trusted = FALSE;
@@ -122,68 +122,72 @@ dkim_module_config (struct config_file *cfg)
dkim_module_ctx->whitelist_ip = radix_tree_create ();
if ((value = get_module_opt (cfg, "dkim", "symbol_reject")) != NULL) {
- dkim_module_ctx->symbol_reject = memory_pool_strdup (dkim_module_ctx->dkim_pool, value);
+ dkim_module_ctx->symbol_reject = rspamd_cl_obj_tostring (value);
}
else {
dkim_module_ctx->symbol_reject = DEFAULT_SYMBOL_REJECT;
}
if ((value = get_module_opt (cfg, "dkim", "symbol_tempfail")) != NULL) {
- dkim_module_ctx->symbol_tempfail = memory_pool_strdup (dkim_module_ctx->dkim_pool, value);
+ dkim_module_ctx->symbol_tempfail = rspamd_cl_obj_tostring (value);
}
else {
dkim_module_ctx->symbol_tempfail = DEFAULT_SYMBOL_TEMPFAIL;
}
if ((value = get_module_opt (cfg, "dkim", "symbol_allow")) != NULL) {
- dkim_module_ctx->symbol_allow = memory_pool_strdup (dkim_module_ctx->dkim_pool, value);
+ dkim_module_ctx->symbol_allow = rspamd_cl_obj_tostring (value);
}
else {
dkim_module_ctx->symbol_allow = DEFAULT_SYMBOL_ALLOW;
}
if ((value = get_module_opt (cfg, "dkim", "dkim_cache_size")) != NULL) {
- cache_size = strtoul (value, NULL, 10);
+ cache_size = rspamd_cl_obj_toint (value);
}
else {
cache_size = DEFAULT_CACHE_SIZE;
}
if ((value = get_module_opt (cfg, "dkim", "dkim_cache_expire")) != NULL) {
- cache_expire = cfg_parse_time (value, TIME_SECONDS) / 1000;
+ cache_expire = rspamd_cl_obj_todouble (value);
}
else {
cache_expire = DEFAULT_CACHE_MAXAGE;
}
if ((value = get_module_opt (cfg, "dkim", "time_jitter")) != NULL) {
- dkim_module_ctx->time_jitter = cfg_parse_time (value, TIME_SECONDS) / 1000;
+ dkim_module_ctx->time_jitter = rspamd_cl_obj_todouble (value);
}
else {
dkim_module_ctx->time_jitter = DEFAULT_TIME_JITTER;
}
if ((value = get_module_opt (cfg, "dkim", "whitelist")) != NULL) {
- if (! add_map (cfg, value, "DKIM whitelist", read_radix_list, fin_radix_list, (void **)&dkim_module_ctx->whitelist_ip)) {
- msg_warn ("cannot load whitelist from %s", value);
+ if (! add_map (cfg, rspamd_cl_obj_tostring (value),
+ "DKIM whitelist", read_radix_list, fin_radix_list,
+ (void **)&dkim_module_ctx->whitelist_ip)) {
+ msg_warn ("cannot load whitelist from %s", rspamd_cl_obj_tostring (value));
}
}
if ((value = get_module_opt (cfg, "dkim", "domains")) != NULL) {
- if (! add_map (cfg, value, "DKIM domains", read_kv_list, fin_kv_list, (void **)&dkim_module_ctx->dkim_domains)) {
- msg_warn ("cannot load dkim domains list from %s", value);
+ if (! add_map (cfg, rspamd_cl_obj_tostring (value),
+ "DKIM domains", read_kv_list, fin_kv_list,
+ (void **)&dkim_module_ctx->dkim_domains)) {
+ msg_warn ("cannot load dkim domains list from %s", rspamd_cl_obj_tostring (value));
}
else {
got_trusted = TRUE;
}
}
if ((value = get_module_opt (cfg, "dkim", "strict_multiplier")) != NULL) {
- dkim_module_ctx->strict_multiplier = strtoul (value, NULL, 10);
+ dkim_module_ctx->strict_multiplier = rspamd_cl_obj_toint (value);
}
else {
dkim_module_ctx->strict_multiplier = 1;
}
if ((value = get_module_opt (cfg, "dkim", "trusted_only")) != NULL) {
- dkim_module_ctx->trusted_only = parse_flag (value) == 1;
+ dkim_module_ctx->trusted_only = rspamd_cl_obj_toboolean (value);
}
else {
dkim_module_ctx->trusted_only = FALSE;
}
if ((value = get_module_opt (cfg, "dkim", "skip_multi")) != NULL) {
- dkim_module_ctx->skip_multi = parse_flag (value) == 1;
+ dkim_module_ctx->skip_multi = rspamd_cl_obj_toboolean (value);
}
else {
dkim_module_ctx->skip_multi = FALSE;