commit ac376ef: [Minor] Dmarc: Properly name a symbol

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Mar 1 16:07:06 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-03-01 16:04:37 +0000
URL: https://github.com/rspamd/rspamd/commit/ac376efeeee2c2cb603fa2a9feca84d8f7c9a478 (HEAD -> master)

[Minor] Dmarc: Properly name a symbol

---
 src/libserver/rspamd_symcache.c | 8 +++++---
 src/plugins/lua/dmarc.lua       | 9 ++++++---
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/libserver/rspamd_symcache.c b/src/libserver/rspamd_symcache.c
index 1b02b62a8..6615cb14e 100644
--- a/src/libserver/rspamd_symcache.c
+++ b/src/libserver/rspamd_symcache.c
@@ -1441,9 +1441,11 @@ rspamd_symcache_validate_cb (gpointer k, gpointer v, gpointer ud)
 	}
 
 	if (!ghost && skipped) {
-		item->type |= SYMBOL_TYPE_SKIPPED;
-		msg_warn_cache ("symbol %s has no score registered, skip its check",
-				item->symbol);
+		if (!(item->type & SYMBOL_TYPE_SKIPPED)) {
+			item->type |= SYMBOL_TYPE_SKIPPED;
+			msg_warn_cache ("symbol %s has no score registered, skip its check",
+					item->symbol);
+		}
 	}
 
 	if (ghost) {
diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua
index 2ef82a0e5..63c92d64f 100644
--- a/src/plugins/lua/dmarc.lua
+++ b/src/plugins/lua/dmarc.lua
@@ -1381,12 +1381,15 @@ if dkim_opts then
 end
 
 local id = rspamd_config:register_symbol({
-  name = 'DMARC_CALLBACK', -- why is it called 'CALLBACK' not 'CHECK' :(
+  name = 'DMARC_CHECK',
   type = 'callback',
-  group = 'policies',
-  groups = {'dmarc'},
   callback = dmarc_callback
 })
+rspamd_config:register_symbol({
+  name = 'DMARC_CALLBACK', -- compatibility symbol
+  type = 'virtual,skip',
+  parent = id,
+})
 rspamd_config:register_symbol({
   name = dmarc_symbols['allow'],
   parent = id,


More information about the Commits mailing list