summaryrefslogtreecommitdiffstats
path: root/src/plugins/dkim_check.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-02-14 16:25:41 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-02-14 16:25:41 +0000
commit557c870057a43e72983e7f03feedbfc150e0b138 (patch)
treec59afd40eb471194d76db1bce97659ac16f9a127 /src/plugins/dkim_check.c
parentd0d0f333d3fd5d10bc6b88dd364cb792e326c8c2 (diff)
downloadrspamd-557c870057a43e72983e7f03feedbfc150e0b138.tar.gz
rspamd-557c870057a43e72983e7f03feedbfc150e0b138.zip
[Project] CDB maps: Start making cdb a first class citizen
Diffstat (limited to 'src/plugins/dkim_check.c')
-rw-r--r--src/plugins/dkim_check.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/plugins/dkim_check.c b/src/plugins/dkim_check.c
index da7e092f7..aa4f4119a 100644
--- a/src/plugins/dkim_check.c
+++ b/src/plugins/dkim_check.c
@@ -446,7 +446,7 @@ dkim_module_config (struct rspamd_config *cfg)
rspamd_kv_list_fin,
rspamd_kv_list_dtor,
(void **)&dkim_module_ctx->dkim_domains,
- NULL)) {
+ NULL, RSPAMD_MAP_DEFAULT)) {
msg_warn_config ("cannot load dkim domains list from %s",
ucl_object_tostring (value));
}
@@ -463,7 +463,7 @@ dkim_module_config (struct rspamd_config *cfg)
rspamd_kv_list_fin,
rspamd_kv_list_dtor,
(void **)&dkim_module_ctx->dkim_domains,
- NULL)) {
+ NULL, RSPAMD_MAP_DEFAULT)) {
msg_warn_config ("cannot load dkim domains list from %s",
ucl_object_tostring (value));
}
@@ -950,9 +950,12 @@ dkim_module_check (struct dkim_check_result *res)
if (dkim_module_ctx->dkim_domains != NULL) {
/* Perform strict check */
+ const gchar *domain = rspamd_dkim_get_domain (cur->ctx);
+
if ((strict_value =
rspamd_match_hash_map (dkim_module_ctx->dkim_domains,
- rspamd_dkim_get_domain (cur->ctx))) != NULL) {
+ domain,
+ strlen (domain))) != NULL) {
if (!dkim_module_parse_strict (strict_value, &cur->mult_allow,
&cur->mult_deny)) {
cur->mult_allow = dkim_module_ctx->strict_multiplier;
@@ -1212,11 +1215,12 @@ dkim_symbol_callback (struct rspamd_task *task,
else {
/* Get key */
cur->ctx = ctx;
+ const gchar *domain = rspamd_dkim_get_domain (cur->ctx);
if (dkim_module_ctx->trusted_only &&
(dkim_module_ctx->dkim_domains == NULL ||
rspamd_match_hash_map (dkim_module_ctx->dkim_domains,
- rspamd_dkim_get_domain (ctx)) == NULL)) {
+ domain, strlen (domain)) == NULL)) {
msg_debug_task ("skip dkim check for %s domain",
rspamd_dkim_get_domain (ctx));