config.regexp['BITCOIN_ADDR'] = {
description = 'Message has a valid bitcoin wallet address',
- -- Use + operator to ensure that each expression is always evaluated
re = string.format('(%s) + (%s) > 0', normal_wallet_re, btc_bleach_re),
+ -- Disable optimizations for this expression to get all addresses
+ expression_flags = { 'noopt' },
re_conditions = {
[normal_wallet_re] = function(task, txt, s, e)
local len = e - s
*/
/***MODULE:regexp
* rspamd module that implements different regexp rules
+ *
+ * For object-based configuration, you can specify:
+ * - `expression_flags`: array of strings or single string with expression flags
+ * - `"noopt"`: disable expression optimizations (useful for some SpamAssassin rules)
*/
sizeof(struct regexp_module_item));
cur_item->symbol = ucl_object_key(value);
cur_item->magic = rspamd_regexp_cb_magic;
+ cur_item->expression_flags = 0; /* Will be overwritten with parsed flags */
ud.cfg = cfg;
ud.conf_obj = value;