The v1 reply path gated the per-key forbidden_ids check on prob > 0.
The DELAY branch above it zeroes ts, prob and value but leaves flag
intact, so a delayed reply took the `else if (default_disabled)` branch
instead: a key with its own forbidden_ids silently lost its ACL and the
global default_forbidden_ids applied after all. That is the same
inversion fixed in the v2 path in the previous commit, just limited to
encrypted delayed replies.
Drop the prob check so the per-key set overrides the default regardless
of the match result, matching rspamd_fuzzy_flag_is_forbidden(). Outside
DELAY this changes nothing: prob == 0 means a miss, where flag is 0 too
and neither set matches.
Only EPOCH10/EPOCH11 clients reach this path.
}
if (flags & RSPAMD_FUZZY_REPLY_ENCRYPTED) {
}
if (flags & RSPAMD_FUZZY_REPLY_ENCRYPTED) {
- if (session->reply.v1.rep.v1.prob > 0 && session->key && session->key->forbidden_ids) {
+ /* No prob check here: a key with its own forbidden_ids
+ * overrides the default regardless of the match result,
+ * otherwise a delayed reply (prob is zeroed, flag is not)
+ * would fall back to default_forbidden_ids. */
+ if (session->key && session->key->forbidden_ids) {
khiter_t k;
k = kh_get(fuzzy_key_ids_set, session->key->forbidden_ids, session->reply.v1.rep.v1.flag);
if (k != kh_end(session->key->forbidden_ids)) {
khiter_t k;
k = kh_get(fuzzy_key_ids_set, session->key->forbidden_ids, session->reply.v1.rep.v1.flag);
if (k != kh_end(session->key->forbidden_ids)) {