You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Allow learning to this storage (default: true = read-only)
53
+
# Allow write operations (learning) to this storage; set true to disallow
54
54
read_only = false;
55
55
56
56
# Map flags to symbols
@@ -187,7 +187,7 @@ Each `rule` section defines a fuzzy storage connection:
187
187
|`max_score`| float | — | Global threshold for this rule (deprecated, use per-flag). |
188
188
|`max_hits`| int | — | Maximum matches per message for this rule. |
189
189
|`mime_types`| array | — | MIME types to check: `["*"]`, `["application/*"]`, etc. |
190
-
|`read_only`| boolean |`true`| If `false`, allow learning to this storage. |
190
+
|`read_only`| boolean |`false`| If `true`, disallow learning (write operations) to this storage. |
191
191
|`skip_unknown`| boolean |`false`| If `true`, don't add default symbol for unmatched flags. |
192
192
|`symbol`| string | — | Default symbol for this rule. |
193
193
|`short_text_direct_hash`| boolean |`false`| Use exact hash for texts shorter than `min_length`. |
@@ -208,6 +208,12 @@ fuzzy_map = {
208
208
}
209
209
```
210
210
211
+
:::warning Flag Uniqueness for Writable Rules
212
+
Flag numbers must be unique across all rules that do not have `read_only = true`. When Rspamd performs a write operation (add or delete), it sends the request to **all** rules whose `fuzzy_map` contains the matching flag and that are not read-only—regardless of which rule matched during scanning. If two writable rules share a flag and one storage rejects writes (e.g., a public third-party server that does not permit writes from your host), a 503 error will be returned.
213
+
214
+
To avoid this: use distinct flag numbers for each writable rule, or set `read_only = true` on third-party rules that should not receive write operations. Setting `read_only = true` on your own local storage rule instead will result in a 404 error when attempting to learn.
215
+
:::
216
+
211
217
Different flags allow a single storage to contain multiple hash categories:
Copy file name to clipboardExpand all lines: docs/tutorials/fuzzy_storage.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -375,13 +375,19 @@ One option is `max_score`, which specifies the threshold for a hash weight:
375
375
376
376
The `mime_types` option specifies which attachment types are checked (or learned) using this fuzzy rule. This option takes a list of valid types in the following format: `["type/subtype", "*/subtype", "type/*", "*"]`, where `*` represents any valid type. In practice, it can be useful to save the hashes for all `application/*` attachments. Texts and embedded images are implicitly checked by `fuzzy_check` plugin, so there is no need to add `image/*` in the list of scanned attachments. Note that attachments and images are searched for an exact match, while texts are matched using the approximate algorithm (shingles).
377
377
378
-
`read_only` is quite an important option required for storage learning. It is set to `read_only=true` by default, restricting thus a storage's learning:
378
+
`read_only` is quite an important option required for storage learning. By default, a rule allows learning (`read_only = false`):
379
379
380
380
~~~hcl
381
381
read_only = true; # disallow learning
382
-
read_only = false; # allow learning
382
+
read_only = false; # allow learning (default)
383
383
~~~
384
384
385
+
:::warning Flag Uniqueness for Writable Rules
386
+
Flag numbers must be unique across all rules that do not have `read_only = true`. Write operations (add/delete) are sent to **all** rules whose `fuzzy_map` contains the matching flag and that are not read-only—regardless of which rule was used for scanning. If two writable rules share a flag and one storage rejects writes (e.g., a public or third-party server that does not permit writes from your host), a 503 error will be returned.
387
+
388
+
To avoid this: use distinct flag numbers for each writable rule, or explicitly set `read_only = true` on third-party rules that should not receive write operations. Setting `read_only = true` on your own local storage rule instead will result in a 404 error when attempting to learn.
389
+
:::
390
+
385
391
`Encryption_key` parameter specifies the **public** key of a storage and enables encryption for all requests.
386
392
387
393
`Algorithm` parameter specifies the algorithm for generating hashes from text parts of emails (for attachments and images [blake2b](https://blake2.net/) is always used).
0 commit comments