commit 7e72daf: [Minor] Do not perform arc signing before dkim checks

Vsevolod Stakhov vsevolod at highsecure.ru
Fri Jan 22 16:14:07 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-01-22 16:09:54 +0000
URL: https://github.com/rspamd/rspamd/commit/7e72daf63809c2336e42a43f11220245d7617ea6 (HEAD -> master)

[Minor] Do not perform arc signing before dkim checks
Issue: #3613

---
 src/plugins/lua/arc.lua   | 7 +++++--
 src/plugins/lua/dmarc.lua | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/plugins/lua/arc.lua b/src/plugins/lua/arc.lua
index 2927c5f69..17be630e9 100644
--- a/src/plugins/lua/arc.lua
+++ b/src/plugins/lua/arc.lua
@@ -446,8 +446,8 @@ if settings.whitelisted_signers_map then
   end
 end
 
-rspamd_config:register_dependency('ARC_CALLBACK', symbols['spf_allow_symbol'])
-rspamd_config:register_dependency('ARC_CALLBACK', symbols['dkim_allow_symbol'])
+rspamd_config:register_dependency('ARC_CALLBACK', 'SPF_CHECK')
+rspamd_config:register_dependency('ARC_CALLBACK', 'DKIM_CHECK')
 
 local function arc_sign_seal(task, params, header)
   local arc_sigs = task:cache_get('arc-sigs')
@@ -758,3 +758,6 @@ rspamd_config:register_symbol(sym_reg_tbl)
 
 -- Do not sign unless checked
 rspamd_config:register_dependency(settings['sign_symbol'], 'ARC_CALLBACK')
+-- We need to check dmarc before signing as we have to produce valid AAR header
+-- see #3613
+rspamd_config:register_dependency(settings['sign_symbol'], 'DMARC_CALLBACK')
diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua
index c96e52455..2ef82a0e5 100644
--- a/src/plugins/lua/dmarc.lua
+++ b/src/plugins/lua/dmarc.lua
@@ -1381,7 +1381,7 @@ if dkim_opts then
 end
 
 local id = rspamd_config:register_symbol({
-  name = 'DMARC_CALLBACK',
+  name = 'DMARC_CALLBACK', -- why is it called 'CALLBACK' not 'CHECK' :(
   type = 'callback',
   group = 'policies',
   groups = {'dmarc'},


More information about the Commits mailing list