aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/dkim_check.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-07-10 12:23:41 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-07-10 12:23:41 +0100
commit25b47c040f5b01ce296a708c72398f38379dccd0 (patch)
treeac674d099ceb590aae69a7d943edda5d31423b04 /src/plugins/dkim_check.c
parent14803e9faeefeee69e97902573f3e367ceaf9744 (diff)
downloadrspamd-25b47c040f5b01ce296a708c72398f38379dccd0.tar.gz
rspamd-25b47c040f5b01ce296a708c72398f38379dccd0.zip
[Feature] Sign message merely after DKIM check
Diffstat (limited to 'src/plugins/dkim_check.c')
-rw-r--r--src/plugins/dkim_check.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/plugins/dkim_check.c b/src/plugins/dkim_check.c
index c3503e7aa..dbe279957 100644
--- a/src/plugins/dkim_check.c
+++ b/src/plugins/dkim_check.c
@@ -231,7 +231,7 @@ gint
dkim_module_config (struct rspamd_config *cfg)
{
const ucl_object_t *value;
- gint res = TRUE, cb_id;
+ gint res = TRUE, cb_id = -1, check_id = -1;
guint cache_size;
gboolean got_trusted = FALSE;
@@ -389,7 +389,7 @@ dkim_module_config (struct rspamd_config *cfg)
128,
g_free, /* Keys are just C-strings */
(GDestroyNotify)rspamd_dkim_sign_key_unref);
- cb_id = rspamd_symbols_cache_add_symbol (cfg->cache,
+ check_id = rspamd_symbols_cache_add_symbol (cfg->cache,
"DKIM_SIGN",
0,
dkim_sign_callback,
@@ -398,6 +398,14 @@ dkim_module_config (struct rspamd_config *cfg)
-1);
msg_info_config ("init condition script for DKIM signing");
+ /*
+ * Allow dkim signing to be executed only after dkim check
+ */
+ if (cb_id > 0) {
+ rspamd_symbols_cache_add_delayed_dependency (cfg->cache,
+ "DKIM_SIGN", dkim_module_ctx->symbol_reject);
+ }
+
}
else {
msg_err_config ("lua script must return "