aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/dkim_check.c
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2016-09-30 15:13:38 +0200
committerAndrew Lewis <nerf@judo.za.org>2016-09-30 15:13:38 +0200
commitb561e9b9cbd86191aec1e51cc776d083b66b14b5 (patch)
tree75f11a5a2a4d4ea3ed65a8480d47d073395806e7 /src/plugins/dkim_check.c
parent81a01f43d3c1de562273b30025b018d38a5aadf6 (diff)
downloadrspamd-b561e9b9cbd86191aec1e51cc776d083b66b14b5.tar.gz
rspamd-b561e9b9cbd86191aec1e51cc776d083b66b14b5.zip
[Minor] Allow for re-enabling default-disabled checks
Diffstat (limited to 'src/plugins/dkim_check.c')
-rw-r--r--src/plugins/dkim_check.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/plugins/dkim_check.c b/src/plugins/dkim_check.c
index 7f9122212..3eb44c386 100644
--- a/src/plugins/dkim_check.c
+++ b/src/plugins/dkim_check.c
@@ -69,6 +69,8 @@ struct dkim_ctx {
guint max_sigs;
gboolean trusted_only;
gboolean skip_multi;
+ gboolean check_local;
+ gboolean check_authed;
};
struct dkim_check_result {
@@ -286,6 +288,20 @@ dkim_module_config (struct rspamd_config *cfg)
dkim_module_ctx->whitelist_ip = radix_create_compressed ();
+ if ((value =
+ rspamd_config_get_module_opt (cfg, "options", "check_local")) != NULL) {
+ dkim_module_ctx->check_local = ucl_obj_toboolean (value);
+ }
+ else {
+ dkim_module_ctx->check_local = FALSE;
+ }
+ if ((value =
+ rspamd_config_get_module_opt (cfg, "options", "check_authed")) != NULL) {
+ dkim_module_ctx->check_authed = ucl_obj_toboolean (value);
+ }
+ else {
+ dkim_module_ctx->check_authed = FALSE;
+ }
if ((value =
rspamd_config_get_module_opt (cfg, "dkim", "symbol_reject")) != NULL) {
dkim_module_ctx->symbol_reject = ucl_obj_tostring (value);
@@ -693,7 +709,8 @@ dkim_symbol_callback (struct rspamd_task *task, void *unused)
guint checked = 0, i;
/* First check if plugin should be enabled */
- if (task->user != NULL || rspamd_inet_address_is_local (task->from_addr)) {
+ if ((!dkim_module_ctx->check_authed && task->user != NULL)
+ || (!dkim_module_ctx->check_local && rspamd_inet_address_is_local (task->from_addr))) {
msg_info_task ("skip DKIM checks for local networks and authorized users");
return;
}