diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/fuzzy_storage.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c index 7d19b6d2d..a6d8be896 100644 --- a/src/fuzzy_storage.c +++ b/src/fuzzy_storage.c @@ -783,6 +783,8 @@ rspamd_fuzzy_make_reply (struct rspamd_fuzzy_cmd *cmd, session->reply.rep.v1.value = 0; } + bool default_disabled = false; + { khiter_t k; @@ -790,10 +792,7 @@ rspamd_fuzzy_make_reply (struct rspamd_fuzzy_cmd *cmd, if (k != kh_end(session->ctx->default_forbidden_ids)) { /* Hash is from a forbidden flag by default */ - session->reply.rep.ts = 0; - session->reply.rep.v1.prob = 0.0f; - session->reply.rep.v1.value = 0; - session->reply.rep.v1.flag = 0; + default_disabled = true; } } @@ -812,6 +811,13 @@ rspamd_fuzzy_make_reply (struct rspamd_fuzzy_cmd *cmd, session->reply.rep.v1.flag = 0; } } + else if (default_disabled) { + /* Hash is from a forbidden flag by default */ + session->reply.rep.ts = 0; + session->reply.rep.v1.prob = 0.0f; + session->reply.rep.v1.value = 0; + session->reply.rep.v1.flag = 0; + } /* We need also to encrypt reply */ ottery_rand_bytes (session->reply.hdr.nonce, @@ -836,6 +842,13 @@ rspamd_fuzzy_make_reply (struct rspamd_fuzzy_cmd *cmd, session->reply.hdr.mac, RSPAMD_CRYPTOBOX_MODE_25519); } + else if (default_disabled) { + /* Hash is from a forbidden flag by default, and there is no encryption override */ + session->reply.rep.ts = 0; + session->reply.rep.v1.prob = 0.0f; + session->reply.rep.v1.value = 0; + session->reply.rep.v1.flag = 0; + } } rspamd_fuzzy_write_reply (session); |