1"use strict";(self.webpackChunkrspamd_docs=self.webpackChunkrspamd_docs||[]).push([[8757],{28453:(e,n,s)=>{s.d(n,{R:()=>c,x:()=>l});var r=s(96540);const d={},i=r.createContext(d);function c(e){const n=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(d):e.components||d:c(e.components),r.createElement(i.Provider,{value:n},e.children)}},35164:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>o,contentTitle:()=>l,default:()=>h,frontMatter:()=>c,metadata:()=>r,toc:()=>t});const r=JSON.parse('{"id":"lua/rspamd_config","title":"Module rspamd_config","description":"Module rspamd_config","source":"@site/docs/lua/rspamd_config.md","sourceDirName":"lua","slug":"/lua/rspamd_config","permalink":"/lua/rspamd_config","draft":false,"unlisted":false,"editUrl":"https://github.com/rspamd/docs.rspamd.com/edit/master/docs/lua/rspamd_config.md","tags":[],"version":"current","frontMatter":{"title":"Module rspamd_config"},"sidebar":"docs","previous":{"title":"Module rspamd_cdb","permalink":"/lua/rspamd_cdb"},"next":{"title":"Module rspamd_cryptobox","permalink":"/lua/rspamd_cryptobox"}}');var d=s(74848),i=s(28453);const c={title:"Module rspamd_config"},l=void 0,o={},t=[{value:"Module <code>rspamd_config</code>",id:"mb0614",level:2},{value:"Example:",id:"example",level:3},{value:"Brief content:",id:"brief-content",level:3},{value:"Methods",id:"methods",level:2},{value:"Method <code>rspamd_config:get_module_opt(mname, optname)</code>",id:"m8428b",level:3},{value:"Method <code>rspamd_config:get_all_opt(mname)</code>",id:"m34838",level:3},{value:"Method <code>rspamd_config:get_ucl()</code>",id:"m430ef",level:3},{value:"Method <code>rspamd_config:get_mempool()</code>",id:"md3fe4",level:3},{value:"Method <code>rspamd_config:get_resolver()</code>",id:"m455f6",level:3},{value:"Method <code>rspamd_config:add_radix_map(mapline[, description])</code>",id:"mf7da8",level:3},{value:"Example:",id:"example-1",level:3},{value:"Method <code>rspamd_config:radix_from_config(mname, optname)</code>",id:"m12730",level:3},{value:"Example:",id:"example-2",level:3},{value:"Method <code>rspamd_config:radix_from_ucl(obj, description)</code>",id:"m6b40f",level:3},{value:"Method <code>rspamd_config:add_hash_map(mapline[, description])</code>",id:"mb0625",level:3},{value:"Example:",id:"example-3",level:3},{value:"Method <code>rspamd_config:add_kv_map(mapline[, description])</code>",id:"m5d685",level:3},{value:"Example:",id:"example-4",level:3},{value:"Method <code>rspamd_config:add_map({args})</code>",id:"md5176",level:3},{value:"Example:",id:"example-5",level:3},{value:"Method <code>rspamd_config:get_maps()</code>",id:"m6bfde",level:3},{value:"Method <code>rspamd_config:get_classifier(name)</code>",id:"m9c606",level:3},{value:"Method <code>rspamd_config:register_symbol(table)</code>",id:"m41f8b",level:3},{value:"Method <code>rspamd_config:register_symbols(callback, [weight], callback_name, [, symbol, ...])</code>",id:"mc1ece",level:3},{value:"Method <code>rspamd_config:register_virtual_symbol(name, weight,)</code>",id:"m271b3",level:3},{value:"Method <code>rspamd_config:register_callback_symbol(name, weight, callback)</code>",id:"m0d399",level:3},{value:"Method <code>rspamd_config:register_dependency(id|name, depname[, hard])</code>",id:"m35f6d",level:3},{value:"Example:",id:"example-6",level:3},{value:"Method <code>rspamd_config:get_symbol_flags(name)</code>",id:"m8f5f3",level:3},{value:"Method <code>rspamd_config:get_symbol_type(name)</code>",id:"md90f3",level:3},{value:"Method <code>rspamd_config:add_symbol_flags(name, flags)</code>",id:"ma2388",level:3},{value:"Method <code>rspamd_config:register_pre_filter(callback[, order])</code>",id:"m80f39",level:3},{value:"Example:",id:"example-7",level:3},{value:"Method <code>rspamd_config:register_post_filter(callback[, order])</code>",id:"mf1f59",level:3},{value:"Method <code>rspamd_config:get_key(name)</code>",id:"m4565d",level:3},{value:"Example:",id:"example-8",level:3},{value:"Method <code>rspamd_config:add_condition(symbol, condition)</code>
1",id:"m75087",level:3},{value:"Example:",id:"example-9",level:3},{value:"Method <code>rspamd_config:enable_symbol(symbol)</code>",id:"m552ab",level:3},{value:"Method <code>rspamd_config:disable_symbol(symbol, [disable_parent=true])</code>",id:"m76ea3",level:3},{value:"Method <code>rspamd_config:get_symbol_parent(symbol)</code>",id:"m00349",level:3},{value:"Method <code>rspamd_config:get_group_symbols(group)</code>",id:"ma9d34",level:3},{value:"Method <code>rspamd_config:get_groups([need_private])</code>",id:"m80ec2",level:3},{value:"Method <code>rspamd_config:promote_symbols_cache_resort()</code>",id:"m9f8de",level:3},{value:"Method <code>rspamd_config:register_settings_id(name, symbols_enabled, symbols_disabled[, policy])</code>",id:"m984b4",level:3},{value:"Method <code>rspamd_config:__newindex(name, callback)</code>",id:"mbe4b1",level:3},{value:"Example:",id:"example-10",level:3},{value:"Method <code>rspamd_config:register_regexp(params)</code>",id:"m7d361",level:3},{value:"Method <code>rspamd_config:replace_regexp(params)</code>",id:"mf4b6d",level:3},{value:"Method <code>rspamd_config:register_regexp_scoped(scope, params)</code>",id:"m3e1a3",level:3},{value:"Method <code>rspamd_config:replace_regexp_scoped(scope, params)</code>",id:"m6f106",level:3},{value:"Method <code>rspamd_config:register_re_selector_scoped(scope, name, selector_str, [delimiter, [flatten]])</code>",id:"m57fd2",level:3},{value:"Method <code>rspamd_config:find_regexp_scope(scope)</code>",id:"m6c96d",level:3},{value:"Method <code>rspamd_config:remove_regexp_scope(scope)</code>",id:"m8ce8e",level:3},{value:"Method <code>rspamd_config:count_regexp_scopes()</code>",id:"m1c4ae",level:3},{value:"Method <code>rspamd_config:list_regexp_scopes()</code>",id:"m38368",level:3},{value:"Method <code>rspamd_config:set_regexp_scope_flags(scope, flags)</code>",id:"m2e707",level:3},{value:"Method <code>rspamd_config:clear_regexp_scope_flags(scope, flags)</code>",id:"m875b0",level:3},{value:"Method <code>rspamd_config:get_regexp_scope_flags(scope)</code>",id:"mce146",level:3},{value:"Method <code>rspamd_config:is_regexp_scope_loaded(scope)</code>",id:"m7f3f9",level:3},{value:"Method <code>rspamd_config:set_regexp_scope_loaded(scope, loaded)</code>",id:"m31921",level:3},{value:"Method <code>rspamd_config:register_worker_script(worker_type, script)</code>",id:"m98713",level:3},{value:"Method <code>rspamd_config:add_on_load(function(cfg, ev_base, worker) ... end)</code>",id:"me739e",level:3},{value:"Example:",id:"example-11",level:3},{value:"Method <code>rspamd_config:add_periodic(event_base, timeout, function(cfg, ev_base) ... end, [jitter = false])</code>",id:"mc71a3",level:3},{value:"Example:",id:"example-12",level:3},{value:"Method <code>rspamd_config:add_post_init(function(cfg) ... end)</code>",id:"mb617c",level:3},{value:"Method <code>rspamd_config:add_config_unload(function(cfg) ... end)</code>",id:"mc6e68",level:3},{value:"Method <code>rspamd_config:get_symbols_count()</code>",id:"m0e0cd",level:3},{value:"Method <code>rspamd_config:get_symbols_cksum()</code>",id:"mbadba",level:3},{value:"Method <code>rspamd_config:get_symbols_counters()</code>",id:"ma379f",level:3},{value:"Method <code>rspamd_config:get_symbols()</code>",id:"mfa49c",level:3},{value:"Method <code>rspamd_config:get_symbol(sym_name)</code>",id:"m025f5",level:3},{value:"Method <code>rspamd_config:get_symbol_callback(name)</code>",id:"m6f5be",level:3},{value:"Method <code>rspamd_config:get_symbol_stat(name)</code>",id:"m6016e",level:3},{value:"Method <code>rspamd_config:set_symbol_callback(name, callback)</code>",id:"m3b08d",level:3},{value:"Method <code>rspamd_config:register_finish_script(callback)</code>",id:"meec0c",level:3},{value:"Method <code>rspamd_config:register_monitored(url, type, [{params}])</code>",id:"meb722",level:3},{value:"Method <code>rspamd_config:add_doc(path, option, doc_string, [{params}])</code>",id:"m0e9a6",level:3},{value:"Method <code>rspamd_config:add_example(path, option, doc_string, example)</code>",id:"mf6643",level:3},{value:"Method <code>rspamd_config:set_peak_cb(function)</code>
1",id:"m22ff8",level:3},{value:"Example:",id:"example-13",level:3},{value:"Method <code>rspamd_config:get_cpu_flags()</code>",id:"mfee9b",level:3},{value:"Method <code>rspamd_config:has_torch()</code>",id:"m05fc7",level:3},{value:"Method <code>rspamd_config:is_mime_utf8()</code>",id:"m0620e",level:3},{value:"Method <code>rspamd_config:experimental_enabled()</code>",id:"m49da1",level:3},{value:"Method <code>rspamd_config:load_ucl(filename[, include_trace])</code>",id:"m05ea1",level:3},{value:"Method <code>rspamd_config:parse_rcl([skip_sections])</code>",id:"m02350",level:3},{value:"Method <code>rspamd_config:init_modules()</code>",id:"mffb1c",level:3},{value:"Method <code>rspamd_config:init_subsystem(str)</code>",id:"m32fef",level:3},{value:"Method <code>rspamd_config:get_tld_path()</code>",id:"m4f77b",level:3},{value:"Method <code>rspamd_config:get_dns_max_requests()</code>",id:"m226f2",level:3},{value:"Method <code>rspamd_config:get_dns_timeout()</code>",id:"mb323b",level:3},{value:"Method <code>rspamd_config:load_custom_tokenizers()</code>",id:"m6a340",level:3},{value:"Method <code>rspamd_config:unload_custom_tokenizers()</code>",id:"m4f2a9",level:3}];function a(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(n.h2,{id:"mb0614",children:["Module ",(0,d.jsx)(n.code,{children:"rspamd_config"})]}),"\n",(0,d.jsxs)(n.p,{children:["This module is used to configure rspamd and is normally available as global\nvariable named ",(0,d.jsx)(n.code,{children:"rspamd_config"}),". Unlike other modules, it is not necessary to\nrequire it before usage."]}),"\n",(0,d.jsx)(n.h3,{id:"example",children:"Example:"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-lua",children:"-- Register some callback symbol\nlocal function foo(task)\n -- do something\nend\nrspamd_config:register_symbol{\n name = 'SYMBOL',\n score = 1.0,\n callback = foo\n\n\n-- Get configuration\nlocal tab = rspamd_config:get_all_opt('module') -- get table for module's options\nlocal opts = rspamd_config:get_key('options') -- get content of the specified key in rspamd configuration\n"})}),"\n",(0,d.jsx)(n.h3,{id:"brief-content",children:"Brief content:"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"Methods"}),":"]}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"Method"}),(0,d.jsx)(n.th,{children:"Description"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m8428b",children:(0,d.jsx)(n.code,{children:"rspamd_config:get_module_opt(mname, optname)"})})}),(0,d.jsxs)(n.td,{children:["Returns value of specified option ",(0,d.jsx)(n.code,{children:"optname"})," for a module ",(0,d.jsx)(n.code,{children:"mname"}),",."]})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m34838",children:(0,d.jsx)(n.code,{children:"rspamd_config:get_all_opt(mname)"})})}),(0,d.jsxs)(n.td,{children:["Returns value of all options for a module ",(0,d.jsx)(n.code,{children:"mname"}),", flattening values into a single table consisting."]})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m430ef",children:(0,d.jsx)(n.code,{children:"rspamd_config:get_ucl()"})})}),(0,d.jsx)(n.td,{children:"Returns full configuration as a native Lua object (ucl to lua conversion)."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#md3fe4",children:(0,d.jsx)(n.code,{children:"rspamd_config:get_mempool()"})})}),(0,d.jsx)(n.td,{children:"Returns static configuration memory pool."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m455f6",children:(0,d.jsx)(n.code,{children:"rspamd_config:get_resolver()"})})}),(0,d.jsx)(n.td,{children:"Returns DNS resolver."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#mf7da8",children:(0,d.jsx)(n.code,{children:"rspamd_config:add_radix_map(mapline[, description])"})})}),(0,d.jsx)(n.td,{children:"Creates new dynamic map of IP/mask addresses."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m
112730",children:(0,d.jsx)(n.code,{children:"rspamd_config:radix_from_config(mname, optname)"})})}),(0,d.jsx)(n.td,{children:"Creates new embedded map of IP/mask addresses from config."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m6b40f",children:(0,d.jsx)(n.code,{children:"rspamd_config:radix_from_ucl(obj, description)"})})}),(0,d.jsx)(n.td,{children:"Creates new embedded map of IP/mask addresses from object."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#mb0625",children:(0,d.jsx)(n.code,{children:"rspamd_config:add_hash_map(mapline[, description])"})})}),(0,d.jsx)(n.td,{children:"Creates new dynamic map string objects."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m5d685",children:(0,d.jsx)(n.code,{children:"rspamd_config:add_kv_map(mapline[, description])"})})}),(0,d.jsx)(n.td,{children:"Creates new dynamic map of key/values associations."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#md5176",children:(0,d.jsx)(n.code,{children:"rspamd_config:add_map({args})"})})}),(0,d.jsx)(n.td,{children:"Creates new dynamic map according to the attributes passed."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m6bfde",children:(0,d.jsx)(n.code,{children:"rspamd_config:get_maps()"})})}),(0,d.jsx)(n.td,{children:"Get all maps defined as an array of rspamd{map} objects."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m9c606",children:(0,d.jsx)(n.code,{children:"rspamd_config:get_classifier(name)"})})}),(0,d.jsx)(n.td,{children:"Returns classifier config."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m41f8b",children:(0,d.jsx)(n.code,{children:"rspamd_config:register_symbol(table)"})})}),(0,d.jsx)(n.td,{children:"Register symbol of a specified type in rspamd."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#mc1ece",children:(0,d.jsx)(n.code,{children:"rspamd_config:register_symbols(callback, [weight], callback_name, [, symbol, ...])"})})}),(0,d.jsx)(n.td,{children:"Register callback function to be called for a set of symbols with initial weight."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m271b3",children:(0,d.jsx)(n.code,{children:"rspamd_config:register_virtual_symbol(name, weight,)"})})}),(0,d.jsx)(n.td,{children:"Register virtual symbol that is not associated with any callback."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m0d399",children:(0,d.jsx)(n.code,{children:"rspamd_config:register_callback_symbol(name, weight, callback)"})})}),(0,d.jsx)(n.td,{children:"Register callback function to be called for a specified symbol with initial weight."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:"[`rspamd_config:register_dependency(id"}),(0,d.jsx)(n.td,{children:"name, depname[, hard])`](#m35f6d)"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m8f5f3",children:(0,d.jsx)(n.code,{children:"rspamd_config:get_symbol_flags(name)"})})}),(0,d.jsx)(n.td,{children:"Returns symbol flags."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#md90f3",children:(0,d.jsx)(n.code,{children:"rspamd_config:get_symbol_type(name)"})})}),(0,d.jsx)(n.td,{children:"Returns the declared type of a symbol and its execution plan."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#ma2388",children:(0,d.jsx)(n.code,{children:"rspamd_config:add_symbol_flags(name, flags)"})})}),(0,d.jsx)(n.td,{children:"Adds flags to a symbol."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m80f39",children:(0,d.jsx)(n.code,{children:"rspamd_config:register_pre_filter(callback[, order])"})})}),(0,d.jsx)(n.td,{children:"Register function to be called prior to symbols processing."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#mf1f59",children:(0,d.jsx)(n.code,{children:"rspamd_config:register_post_filter(callback[, order])"})})}),(0,d.jsx)(n.td,{children:"Register function to be called after symbols are processed."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m4565d",children:(0,d.jsx)(n.code,{children:"rspamd_config:get_key(name)"})})}),(0,d.jsxs)(n.td,{children:["Returns configuration section with the specified ",(0,d.jsx)(n.code,{children:"name"}),"."]})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m75087",children:(0,d.jsx)(n.code,{children:"rspamd_config:add_condition(symbol, condition)"})})}),(0,d.jsx)(n.td,{children:"Adds condition callback for specified symbol."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m552ab",children:(0,d.jsx)(n.code,{children:"rspamd_config:enable_symbol(symbol)"})})}),(0,d.jsx)(n.td,{children:"Enables execution for the specified symbol."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m76ea3",children:(0,d.jsx)(n.code,{children:"rspamd_config:disable_symbol(symbol, [disable_parent=true])"})})}),(0,d.jsx)(n.td,{children:"Disables execution for the specified symbol."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m00349",children:(0,d.jsx)(n.code,{children:"rspamd_config:get_symbol_parent(symbol)"})})}),(0,d.jsx)(n.td,{children:"Returns a parent symbol for specific symbol (or symbol itself if top level)."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#ma9d34",children:(0,d.jsx)(n.code,{children:"rspamd_config:get_group_symbols(group)"})})}),(0,d.jsx)(n.td,{children:"Returns list of symbols for a specific group."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m80ec2",children:(0,d.jsx)(n.code,{children:"rspamd_config:get_groups([need_private])"})})}),(0,d.jsx)(n.td,{children:"Returns list of all groups defined."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m9f8de",children:(0,d.jsx)(n.code,{children:"rspamd_config:promote_symbols_cache_resort()"})})}
1),(0,d.jsx)(n.td,{children:"Promote symbols cache resort after dynamic symbol registration."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m984b4",children:(0,d.jsx)(n.code,{children:"rspamd_config:register_settings_id(name, symbols_enabled, symbols_disabled[, policy])"})})}),(0,d.jsx)(n.td,{children:"Register new static settings id in config."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#mbe4b1",children:(0,d.jsx)(n.code,{children:"rspamd_config:__newindex(name, callback)"})})}),(0,d.jsxs)(n.td,{children:["This metamethod is called if new indices are added to the ",(0,d.jsx)(n.code,{children:"rspamd_config"})," object."]})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m7d361",children:(0,d.jsx)(n.code,{children:"rspamd_config:register_regexp(params)"})})}),(0,d.jsx)(n.td,{children:"Registers new re for further cached usage."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#mf4b6d",children:(0,d.jsx)(n.code,{children:"rspamd_config:replace_regexp(params)"})})}),(0,d.jsx)(n.td,{children:"Replaces regexp with a new one."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m3e1a3",children:(0,d.jsx)(n.code,{children:"rspamd_config:register_regexp_scoped(scope, params)"})})}),(0,d.jsx)(n.td,{children:"Registers new re for further cached usage in a specific scope."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m6f106",children:(0,d.jsx)(n.code,{children:"rspamd_config:replace_regexp_scoped(scope, params)"})})}),(0,d.jsx)(n.td,{children:"Replaces regexp with a new one in a specific scope."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m57fd2",children:(0,d.jsx)(n.code,{children:"rspamd_config:register_re_selector_scoped(scope, name, selector_str, [delimiter, [flatten]])"})})}),(0,d.jsx)(n.td,{children:"Registers selector with the specific name in a specific scope to use in regular expressions."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m6c96d",children:(0,d.jsx)(n.code,{children:"rspamd_config:find_regexp_scope(scope)"})})}),(0,d.jsx)(n.td,{children:"Checks if a regexp scope exists."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m8ce8e",children:(0,d.jsx)(n.code,{children:"rspamd_config:remove_regexp_scope(scope)"})})}),(0,d.jsx)(n.td,{children:"Removes a regexp scope from the cache."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m1c4ae",children:(0,d.jsx)(n.code,{children:"rspamd_config:count_regexp_scopes()"})})}),(0,d.jsx)(n.td,{children:"Returns the number of regexp scopes."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m38368",children:(0,d.jsx)(n.code,{children:"rspamd_config:list_regexp_scopes()"})})}),(0,d.jsx)(n.td,{children:"Returns a list of all regexp scope names."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m2e707",children:(0,d.jsx)(n.code,{children:"rspamd_config:set_regexp_scope_flags(scope, flags)"})})}),(0,d.jsx)(n.td,{children:"Sets flags for a regexp scope."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m875b0",children:(0,d.jsx)(n.code,{children:"rspamd_config:clear_regexp_scope_flags(scope, flags)"})})}),(0,d.jsx)(n.td,{children:"Clears flags for a regexp scope."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#mce146",children:(0,d.jsx)(n.code,{children:"rspamd_config:get_regexp_scope_flags(scope)"})})}),(0,d.jsx)(n.td,{children:"Gets flags for a regexp scope."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m7f3f9",children:(0,d.jsx)(n.code,{children:"rspamd_config:is_regexp_scope_loaded(scope)"})})}),(0,d.jsx)(n.td,{children:"Checks if a regexp scope is loaded and ready for use."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m31921",children:(0,d.jsx)(n.code,{children:"rspamd_config:set_regexp_scope_loaded(scope, loaded)"})})}),(0,d.jsx)(n.td,{children:"Sets the loaded state of a regexp scope."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m98713",children:(0,d.jsx)(n.code,{children:"rspamd_config:register_worker_script(worker_type, script)"})})}),(0,d.jsx)(n.td,{children:"Registers the following script for workers of a specified type."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#me739e",children:(0,d.jsx)(n.code,{children:"rspamd_config:add_on_load(function(cfg, ev_base, worker) ... end)"})})}),(0,d.jsx)(n.td,{children:"Registers the following script to be executed when configuration is completely loaded."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#mc71a3",children:(0,d.jsx)(n.code,{children:"rspamd_config:add_periodic(event_base, timeout, function(cfg, ev_base) ... end, [jitter = false])"})})}),(0,d.jsx)(n.td,{children:"Registers function to be periodically executed by Rspamd."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#mb617c",children:(0,d.jsx)(n.code,{children:"rspamd_config:add_post_init(function(cfg) ... end)"})})}),(0,d.jsx)(n.td,{children:"Registers the following script to be executed when configuration is completely loaded."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#mc6e68",children:(0,d.jsx)(n.code,{children:"rspamd_config:add_config_unload(function(cfg) ... end)"})})}),(0,d.jsx)(n.td,{children:"Registers the following script to be executed when configuration is unloaded."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m0e0cd",children:(0,d.jsx)(n.code,{children:"rspamd_config:get_symbols_count()"})})}),(0,d.jsx)(n.td,{children:"Returns number of symbols registered in rspamd configuration."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#mbadba",children:(0,d.jsx)(n.code,{children:"rspamd_config:get_symbols_cksum()"})})}),(0,d.jsx)(n.td,{children:"Returns checksum for all symbols in the cache."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#ma379f",children:(0,d.jsx)(n.code,{children:"rspamd_config:get_symbols_counters()"})})}),(0,d.jsx)(n.td,{children:"Returns table of all counters in the cache (weights, frequencies etc)."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#mfa49c",children:(0,d.jsx)(n.code,{children:"rspamd_config:get_symbols()"})})}),(0,d.jsx)(n.td,{children:"Returns table of all scores defined in config."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m025f5",children:(0,d.jsx)(n.code,{children:"rspamd_config:get_symbol(sym_name)"})})}),(0,d.jsx)(n.td,{children:"Returns table for a specific symbol getting data from the static config."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m6f5be",children:(0,d.jsx)(n.code,{children:"rspamd_config:get_symbol_callback(name)"})})}),(0,d.jsx)(n.td,{children:"Returns callback function for the specified symbol if it is a lua registered callback."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m6016e",children:(0,d.jsx)(n.code,{children:"rspamd_config:get_symbol_stat(name)"})})}),(0,d.jsx)(n.td,{children:"Returns table with statistics for a specific symbol."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m3b08d",children:(0,d.jsx)(n.code,{children:"rspamd_config:set_symbol_callback(name, callback)"})})}),(0,d.jsx)(n.td,{children:"Sets callback for the specified symbol."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#meec0c",children:(0,d.jsx)(n.code,{children:"rspamd_config:register_finish_script(callback)"})})}),(0,d.jsx)(n.td,{children:"Adds new callback that is called on worker process termination when all."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#meb722",children:(0,d.jsx)(n.code,{children:"rspamd_config:register_monitored(url, type, [{params}])"})})}),(0,d.jsx)(n.td,{children:"Registers monitored resource to watch its availability."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m0e9a6",children:(0,d.jsx)(n.code,{children:"rspamd_config:add_doc(path, option, doc_string, [{params}])"})})}),(0,d.jsxs)(n.td,{children:["Adds new documentation string for an option ",(0,d.jsx)(n.code,{children:"option"})," at path ",(0,d.jsx)(n.code,{children:"path"}),"."]})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#mf6643",children:(0,d.jsx)(n.code,{children:"rspamd_config:add_example(path, option, doc_string, example)"})})}),(0,d.jsx)(n.td,{children:"Adds new documentation."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m22ff8",children:(0,d.jsx)(n.code,{children:"rspamd_config:set_peak_cb(function)"})})}),(0,d.jsx)(n.td,{children:"Sets a function that will be called when frequency of some symbol goes out of."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#mfee9b",children:(0,d.jsx)(n.code,{children:"rspamd_config:get_cpu_flags()"})})}),(0,d.jsx)(n.td,{children:"Returns architecture dependent flags supported by the CPU."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m05fc7",children:(0,d.jsx)(n.code,{children:"rspamd_config:has_torch()"})})}),(0,d.jsx)(n.td,{children:"Returns true if Rspamd is compiled with torch support and the runtime CPU."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m0620e",children:(0,d.jsx)(n.code,{children:"rspamd_config:is_mime_utf8()"})})}),(0,d.jsx)(n.td,{children:"Returns true if Rspamd is configured to use UTF for mime processing."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m49da1",children:(0,d.jsx)(n.code,{children:"rspamd_config:experimental_enabled()"})})}),(0,d.jsx)(n.td,{children:"Returns true if experimental plugins are enabled."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m05ea1",children:(0,d.jsx)(n.code,{children:"rspamd_config:load_ucl(filename[, include_trace])"})})}),(0,d.jsx)(n.td,{children:"Loads config from the UCL file (but does not perform parsing using rcl)."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m02350",children:(0,d.jsx)(n.code,{children:"rspamd_config:parse_rcl([skip_sections])"})})}),(0,d.jsx)(n.td,{children:"Parses RCL using loaded ucl file."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#mffb1c",children:(0,d.jsx)(n.code,{children:"rspamd_config:init_modules()"})})}),(0,d.jsx)(n.td,{children:"Initialize lua and internal modules."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m32fef",children:(0,d.jsx)(n.code,{children:"rspamd_config:init_subsystem(str)"})})}),(0,d.jsx)(n.td,{children:"Initialize config subsystem from a comma separated list."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m4f77b",children:(0,d.jsx)(n.code,{children:"rspamd_config:get_tld_path()"})})}
1),(0,d.jsx)(n.td,{children:"Returns path to TLD file."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m226f2",children:(0,d.jsx)(n.code,{children:"rspamd_config:get_dns_max_requests()"})})}),(0,d.jsx)(n.td,{children:"Returns limit of DNS requests per task."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#mb323b",children:(0,d.jsx)(n.code,{children:"rspamd_config:get_dns_timeout()"})})}),(0,d.jsx)(n.td,{children:"Returns timeout for a DNS request."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m6a340",children:(0,d.jsx)(n.code,{children:"rspamd_config:load_custom_tokenizers()"})})}),(0,d.jsx)(n.td,{children:"Loads custom tokenizers from configuration."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.a,{href:"#m4f2a9",children:(0,d.jsx)(n.code,{children:"rspamd_config:unload_custom_tokenizers()"})})}),(0,d.jsx)(n.td,{children:"Unloads custom tokenizers and frees memory."})]})]})]}),"\n",(0,d.jsx)(n.h2,{id:"methods",children:"Methods"}),"\n",(0,d.jsxs)(n.p,{children:["The module ",(0,d.jsx)(n.code,{children:"rspamd_config"})," defines the following methods."]}),"\n",(0,d.jsxs)(n.h3,{id:"m8428b",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:get_module_opt(mname, optname)"})]}),"\n",(0,d.jsxs)(n.p,{children:["Returns value of specified option ",(0,d.jsx)(n.code,{children:"optname"})," for a module ",(0,d.jsx)(n.code,{children:"mname"}),","]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"mname {string}"}),": name of module"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"optname {string}"}),": option to get"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{string or table}"}),": value of the option or ",(0,d.jsx)(n.code,{children:"nil"})," if option is not found"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m34838",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:get_all_opt(mname)"})]}),"\n",(0,d.jsxs)(n.p,{children:["Returns value of all options for a module ",(0,d.jsx)(n.code,{children:"mname"}),", flattening values into a single table consisting\nof all sections with such a name."]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"mname {string}"}),": name of module"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{table}"}),": table of all options for ",(0,d.jsx)(n.code,{children:"mname"})," or ",(0,d.jsx)(n.code,{children:"nil"})," if a module's configuration is not found"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m430ef",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:get_ucl()"})]}),"\n",(0,d.jsx)(n.p,{children:"Returns full configuration as a native Lua object (ucl to lua conversion).\nThis method uses caching if possible."}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{table}"}),": table of all options in the configuration"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"md3fe4",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:get_mempool()"})]}),"\n",(0,d.jsx)(n.p,{children:"Returns static configuration memory pool."}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{mempool}"}),": ",(0,d.jsx)(n.a,{href:"/lua/rspamd_mempool",children:"memory pool"})," object"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m455f6",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:get_resolver()"})]}),"\n",(0,d.jsx)(n.p,{children:"Returns DNS resolver."}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{dns_resolver}"}),": opaque DNS resolver pointer if any"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"mf7da8",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:add_radix_map(mapline[, description])"})]}),"\n",(0,d.jsx)(n.p,{children:"Creates new dynamic map of IP/mask addresses."}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"mapline {string}"}),": URL for a map"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"description {string}"}),": optional map description"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{map}"}),": radix tree object"]}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"example-1",children:"Example:"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-lua",children:"local ip_map = rspamd_config:add_radix_map ('file:///path/to/file', 'my radix map')\n...\nlocal function foo(task)\n\tlocal ip = task:get_from_ip()\n\tif ip_map:get_key(ip) then\n\t\treturn true\n\tend\n\treturn false\nend\n"})}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m12730",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:radix_from_config(mname, optname)"})]}),"\n",(0,d.jsx)(n.p,{children:"Creates new embedded map of IP/mask addresses from config."}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"mname {string}"}),": name of module"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"optname {string}"}),": option to get"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{map}"}),": radix tree object"]}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"example-2",children:"Example:"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-lua",children:"local ip_map = rspamd_config:radix_from_config ('mymodule', 'ips')\n...\nlocal function foo(task)\n\tlocal ip = task:get_from_ip()\n\tif ip_map:get_key(ip) then\n\t\treturn true\n\tend\n\treturn false\nend\n"})}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m6b40f",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:radix_from_ucl(obj, description)"})]}),"\n",(0,d.jsx)(n.p,{children:"Creates new embedded map of IP/mask addresses from object."}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"obj {ucl}"}),": object"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{map}"}),": radix tree object"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"mb0625",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:add_hash_map(mapline[, description])"})]}),"\n",(0,d.jsx)(n.p,{children:"Creates new dynamic map string objects."}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"mapline {string}"}),": URL for a map"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"description {string}"}),": optional map description"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{map}"}),": hash set object"]}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"example-3",children:"Example:"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-lua",children:"local hash_map = rspamd_config:add_hash_map ('file:///path/to/file', 'my hash map')\n...\nlocal function foo(task)\n\tlocal from = task:get_from()\n\tif hash_map:get_key(from['user']) then\n\t\treturn true\n\tend\n\treturn false\nend\n"})}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m5d685",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:add_kv_map(mapline[, description])"})]}),"\n",(0,d.jsx)(n.p,{children:"Creates new dynamic map of key/values associations."}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"mapline {string}"}),": URL for a map"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"description {string}"}),": optional map description"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{map}"}),": hash table object"]}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"example-4",children:"Example:"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-lua",children:"local kv_map = rspamd_config:add_kv_map ('file:///path/to/file', 'my kv map')\n...\nlocal function foo(task)\n\tlocal from = task:get_from()\n\tif from then\n\t\tlocal value = kv_map:get_key(from['user'])\n\t\tif value then\n\t\t\treturn true,value\
1n\t\tend\n\tend\n\treturn false\nend\n"})}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"md5176",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:add_map({args})"})]}),"\n",(0,d.jsx)(n.p,{children:"Creates new dynamic map according to the attributes passed."}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"type"}),": type of map to be created, can be one of the following set:\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"set"}),": set of strings"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"radix"}),": map of IP addresses to strings"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"map"}),": map of strings to strings"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"regexp"}),": map of regexps to strings"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"callback"}),": map processed by lua callback"]}),"\n"]}),"\n"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"url"}),": url to load map from"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"description"}),": map's description"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"callback"}),": lua callback for the map"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{map}"}),": ",(0,d.jsx)(n.code,{children:"true"})," if map has been added"]}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"example-5",children:"Example:"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-lua",children:"\nlocal str = ''\nlocal function process_map(in)\n\tstr = in\nend\n\nrspamd_config:add_map('http://example.com/map', \"settings map\", process_map)\n"})}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m6bfde",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:get_maps()"})]}),"\n",(0,d.jsx)(n.p,{children:"Get all maps defined as an array of rspamd{map} objects"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{table|rspamd{map}"}),": }"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m9c606",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:get_classifier(name)"})]}),"\n",(0,d.jsx)(n.p,{children:"Returns classifier config."}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"name {string}"}),": name of classifier (e.g. ",(0,d.jsx)(n.code,{children:"bayes"}),")"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{classifier}"}),": classifier object or ",(0,d.jsx)(n.code,{children:"nil"})]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m41f8b",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:register_symbol(table)"})]}),"\n",(0,d.jsx)(n.p,{children:"Register symbol of a specified type in rspamd. This function accepts table of arguments:"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"name"}),": name of symbol (can be missing for callback symbols)"]}),"\n"]}),"\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"callback"}),": function to be called for symbol's check (can be absent for virtual symbols)"]}),"\n"]}),"\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"weight"}),": weight of symbol (should normally be 1 or missing)"]}),"\n"]}),"\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"priority"}),": priority of symbol (normally 0 or missing); for prefilters, connfilters,\npostfilters and idempotent symbols it defines the execution level within the stage\n(see below), for normal symbols it is merely a soft ordering hint"]}),"\n"]}),"\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"type"}),": type of symbol:"]}
1),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"normal"}),": executed after prefilters, according to dependency graph or in undefined order"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"callback"}),": a check that merely inserts virtual symbols"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"connfilter"}),": executed early; before message body is available"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"idempotent"}),": cannot change result in any way; executed last"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"postfilter"}),": executed after most other checks"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"prefilter"}),": executed before most other checks"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"virtual"}),": a symbol inserted by its parent check"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["All types share one dependency graph. Prefilters (and connfilters) with a higher\npriority run before the ones with a lower priority, and a prefilter may not start\nuntil every prefilter with a higher priority has finished; prefilters of the same\npriority run concurrently. Postfilters and idempotent symbols are ordered the other\nway round: a higher priority runs later. A prefilter may depend on a normal symbol\n(see ",(0,d.jsx)(n.code,{children:"register_dependency"}),"): that symbol, with its own dependencies, is then executed\nat the prefilter stage at the level of the depending prefilter."]}),"\n"]}),"\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"flags"}),": various flags split by commas or spaces:"]}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"nice"})," if symbol can produce negative score;"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"empty"})," if symbol can be called for empty messages"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"skip"})," if symbol should be skipped now"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"nostat"})," if symbol should be excluded from stat tokens"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"trivial"})," symbol is trivial (e.g. no network requests)"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"explicit_disable"})," requires explicit disabling (e.g. via settings)"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"ignore_passthrough"})," executed even if passthrough result has been set"]}),"\n"]}),"\n"]}),"\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"parent"}),": id of parent symbol (useful for virtual symbols)"]}),"\n"]}),"\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"score"}),": default score of the symbol"]}),"\n"]}),"\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"description"}),": description of the symbol"]}),"\n"]}),"\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"group"}),": group of the symbol (ungrouped if missing)"]}),"\n"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{number}"}),": id of symbol registered"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"mc1ece",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:register_symbols(callback, [weight], callback_name, [, symbol, ...])"})]}),"\n",(0,d.jsx)(n.p,{children:"Register callback function to be called for a set of symbols with initial weight."}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"callback {function}"}),": callback function to be called for a specified symbol"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"weight {number}"}),": initial weight of symbol (can be less than zero to specify non-s
1pam symbols)"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"callback_name {string}"}),": symbolic name of callback"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"symbol {list of strings}"}),": list of symbols registered by this function"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsx)(n.p,{children:"No return"}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m271b3",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:register_virtual_symbol(name, weight,)"})]}),"\n",(0,d.jsx)(n.p,{children:"Register virtual symbol that is not associated with any callback."}),"\n",(0,d.jsx)(n.p,{children:"**This method is deprecated and should not be used in newly written code **"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"virtual {string}"}),": name symbol's name"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"weight {number}"}),": initial weight of symbol (can be less than zero to specify non-s
1pam symbols)"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsx)(n.p,{children:"No return"}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m0d399",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:register_callback_symbol(name, weight, callback)"})]}),"\n",(0,d.jsx)(n.p,{children:"Register callback function to be called for a specified symbol with initial weight. Symbol itself is\nnot registered in the metric and is not intended to be visible by a user."}),"\n",(0,d.jsx)(n.p,{children:"**This method is deprecated and should not be used in newly written code **"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"name {string}"}),": symbol's name (just for unique id purposes)"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"weight {number}"}),": initial weight of symbol (can be less than zero to specify non-s
1pam symbols)"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"callback {function}"}),": callback function to be called for a specified symbol"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsx)(n.p,{children:"No return"}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m35f6d",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:register_dependency(id|name, depname[, hard])"})]}),"\n",(0,d.jsxs)(n.p,{children:["Create a dependency on symbol identified by name for symbol identified by ID or name.\nThis affects order of checks only (a symbol is still checked if its dependencies are\ndisabled), unless ",(0,d.jsx)(n.code,{children:"hard"})," is set: then the dependent symbol is not executed when its\ndependency has been disabled or skipped."]}),"\n",(0,d.jsxs)(n.p,{children:["A dependency may point to the same stage or to an earlier one (e.g. a normal symbol\ndepending on a prefilter, a postfilter depending on a normal symbol). A prefilter\nmay also depend on a normal symbol: that symbol is then hoisted to the prefilter\nstage together with its own dependencies, so the cost of the dependency is paid\nbefore the prefilter decision. Other edges to a later stage are rejected at the\nconfiguration time; ",(0,d.jsx)(n.code,{children:"rspamadm configdump -e"})," shows the resulting execution plan."]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"id {number|string}"}),": id or name of source (numeric id is returned by all register_*_symbol)"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"depname {string}"}),": dependency name"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"hard {boolean}"}),": if true, the source is skipped when the dependency is disabled or skipped"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsx)(n.p,{children:"No return"}),"\n",(0,d.jsx)(n.h3,{id:"example-6",children:"Example:"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-lua",children:"local function cb(task)\n...\nend\n\nlocal id = rspamd_config:register_symbol('SYM', 1.0, cb)\nrspamd_config:register_dependency(id, 'OTHER_SYM')\n-- Alternative form\n-- Symbol MY_RULE needs result from SPF_CHECK\nrspamd_config:register_dependency('MY_RULE', 'SPF_CHECK')\n"})}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m8f5f3",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:get_symbol_flags(name)"})]}),"\n",(0,d.jsx)(n.p,{children:"Returns symbol flags"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"name {string}"}),": symbols's name"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{table|string}"}),": list of flags for symbol or nil"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"md90f3",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:get_symbol_type(name)"})]}),"\n",(0,d.jsxs)(n.p,{children:["Returns the declared type of a symbol and its execution plan. The type is one\nof ",(0,d.jsx)(n.code,{children:"connfilter"}),", ",(0,d.jsx)(n.code,{children:"prefilter"}),", ",(0,d.jsx)(n.code,{children:"filter"}),", ",(0,d.jsx)(n.code,{children:"postfilter"}),", ",(0,d.jsx)(n.code,{children:"idempotent"}),",\n",(0,d.jsx)(n.code,{children:"composite"}),", ",(0,d.jsx)(n.code,{children:"classifier"})," or ",(0,d.jsx)(n.code,{children:"virtual"}),". For the executed symbols (and for the\nvirtual symbols of executed parents) the stage that runs the symbol\n(",(0,d.jsx)(n.code,{children:"connfilters"}),", ",(0,d.jsx)(n.code,{children:"prefilters"}),", ",(0,d.jsx)(n.code,{children:"filters"}),", ",(0,d.jsx)(n.code,{children:"postfilters"}),", ",(0,d.jsx)(n.code,{children:"idempotent"}),") and its\nlevel within the stage are also returned."]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"name {string}"}),": symbol's name"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{string,
1string,number}"}),": type, stage, level (or nil if the symbol is unknown)"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"ma2388",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:add_symbol_flags(name, flags)"})]}),"\n",(0,d.jsx)(n.p,{children:"Adds flags to a symbol"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"name {string}"}),": symbols's name"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"flags {table|string}"}),": flags to add"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{table|string}"}),": new set of flags"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m80f39",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:register_pre_filter(callback[, order])"})]}),"\n",(0,d.jsx)(n.p,{children:"Register function to be called prior to symbols processing."}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"callback {function}"}),": callback function"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"order {number}"}),": filters are called from lower orders to higher orders, order is equal to 0 by default"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsx)(n.p,{children:"No return"}),"\n",(0,d.jsx)(n.h3,{id:"example-7",children:"Example:"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-lua",children:"local function check_function(task)\n\t-- It is possible to manipulate the task object here: set settings, set pre-action and so on\n\t...\nend\n\nrspamd_config:register_pre_filter(check_function)\n"})}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"mf1f59",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:register_post_filter(callback[, order])"})]}),"\n",(0,d.jsx)(n.p,{children:"Register function to be called after symbols are processed."}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"callback {function}"}),": callback function"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"order {number}"}),": filters are called from lower orders to higher orders, order is equal to 0 by default"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsx)(n.p,{children:"No return"}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m4565d",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:get_key(name)"})]}),"\n",(0,d.jsxs)(n.p,{children:["Returns configuration section with the specified ",(0,d.jsx)(n.code,{children:"name"}),"."]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"name {string}"}),": name of config section"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{variant}"}),": specific value of section"]}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"example-8",children:"Example:"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-lua",children:'\nlocal set_section = rspamd_config:get_key("settings")\nif type(set_section) == "string" then\n -- Just a map of ucl\n if rspamd_config:add_map(set_section, "settings map", process_settings_map) then\n rspamd_config:register_pre_filter(check_settings)\n end\nelseif type(set_section) == "table" then\n if process_settings_table(set_section) then\n rspamd_config:register_pre_filter(check_settings)\n end\nend\n'})}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m75087",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:add_condition(symbol, condition)"})]}),"\n",(0,d.jsx)(n.p,{children:"Adds condition callback for specified symbol"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"symbol {string}"}),": symbol's name"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"condition {function}"}),": condition callback"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{boolean}"}),": true if condition has been added"]}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"example-9",children:"Example:"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-lua",children:"\nlocal condition_map = rspamd_config:add_map{\n type = \"hash\",\n urls = ['file:///path/to/file'],\n description = 'SMTP from map that allows FUZZY_DENIED skip for the listed addresses'\n\nrspamd_config:add_condition('FUZZY_DENIED', function(task)\n local E = {}\n -- Check for the smtp from address adding fail safe checks\n if condition_map:find_key(((task:get_from('smtp') or E)[1] or E).addr) then\n return false\n end\n -- Allow execution otherwise\n return true\nend)\n"})}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m552ab",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:enable_symbol(symbol)"})]}),"\n",(0,d.jsx)(n.p,{children:"Enables execution for the specified symbol"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"symbol {string}"}),": symbol's name"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsx)(n.p,{children:"No return"}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m76ea3",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:disable_symbol(symbol, [disable_parent=true])"})]}),"\n",(0,d.jsx)(n.p,{children:"Disables execution for the specified symbol"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"symbol {string}"}),": symbol's name"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"disable_parent {boolean}"}),": if true then disable parent execution in case of a virtual symbol"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsx)(n.p,{children:"No return"}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m00349",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:get_symbol_parent(symbol)"})]}),"\n",(0,d.jsx)(n.p,{children:"Returns a parent symbol for specific symbol (or symbol itself if top level)"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"symbol {string}"}),": symbol's name"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsx)(n.p,{children:"No return"}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"ma9d34",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:get_group_symbols(group)"})]}),"\n",(0,d.jsx)(n.p,{children:"Returns list of symbols for a specific group"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"group {string}"}),": group's name"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{list|string}"}),": list of all symbols in a specific group"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"Available in:"})," 2.0+"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m80ec2",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:get_groups([need_private])"})]}),"\n",(0,d.jsx)(n.p,{children:"Returns list of all groups defined"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"need_private {boolean}"}),": optional flag to include private groups"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{list|table}"}),": list of all groups"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"Available in:"})," 2.3+"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m9f8de",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:promote_symbols_cache_resort()"})]}
1),"\n",(0,d.jsx)(n.p,{children:"Promote symbols cache resort after dynamic symbol registration"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{boolean}"}),": true if successful"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m984b4",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:register_settings_id(name, symbols_enabled, symbols_disabled[, policy])"})]}),"\n",(0,d.jsxs)(n.p,{children:["Register new static settings id in config\n",(0,d.jsx)(n.code,{children:"implicit_allow"})," is assumed if ",(0,d.jsx)(n.code,{children:"symbols_enabled"})," is empty, ",(0,d.jsx)(n.code,{children:"default"})," (whitelist) otherwise"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"name {string}"}),": id name (not numeric!)"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"symbols_enabled {map|string->string}"}),": map from symbol's name to boolean (currently)"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"symbols_disabled {map|string->string}"}),": map from symbol's name to boolean (currently)"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"policy {string}"}),": one of ",(0,d.jsx)(n.code,{children:"default"}),", ",(0,d.jsx)(n.code,{children:"implicit_allow"})," or ",(0,d.jsx)(n.code,{children:"implicit_deny"}),"; when omitted,"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsx)(n.p,{children:"No return"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"Available in:"})," 2.0+"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"mbe4b1",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:__newindex(name, callback)"})]}),"\n",(0,d.jsxs)(n.p,{children:["This metamethod is called if new indices are added to the ",(0,d.jsx)(n.code,{children:"rspamd_config"})," object.\nTechnically, it is the equivalent of ",(0,d.jsx)(n.a,{href:"#f5b81b",children:(0,d.jsx)(n.code,{children:"rspamd_config:register_symbol"})})," where ",(0,d.jsx)(n.code,{children:"weight"})," is 1.0.\nThere is also table form invocation that allows to control more things:"]}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"callback"}),": has the same meaning and acts as function of task"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"score"}),": default score for a symbol"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"group"}),": default group for a symbol"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"description"}),": default symbol's description"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"priority"}),": additional priority value"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"one_shot"}),": default value for one shot attribute"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"condition"}),": function of task that can enable or disable this specific rule's execution"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"name {string}"}),": index name"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"callback {function/table}"}),": callback to be called"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{number}"}),": id of the new symbol added"]}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"example-10",children:"Example:"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-lua",children:"rspamd_config.R_EMPTY_IMAGE = function (task)\n\tparts = task:get_text_parts()\n\tif parts then\n\t\tfor _,part in ipairs(parts) do\n\t\t\tif part:is_empty() then\n\t\t\t\timages = task:get_images()\n\t\t\t\tif images then\n\t\t\t\t\t-- Symbol `R_EMPTY_IMAGE` is inserted\n\t\t\t\t\treturn true\n\t\t\t\tend\n\t\t\t\treturn false\n\t\t\tend\n\t\tend\n\tend\n\treturn false\nend\n\nrspamd_config.SYMBOL = {\n\tcallback = function(task)\n \t...\n \tend,\n \tscore = 5.1,\n \tdescription = 'sample symbol',\n \tgroup = 'sample symbols',\n \tcondition = function(task)\n \t\tif task:get_from()[1]['addr'] == '[email protected]' then\n \t\t\treturn false\n \t\tend\n \t\treturn true\n \tend\n\n"})}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m7d361",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:register_regexp(params)"})]}),"\n",(0,d.jsxs)(n.p,{children:["Registers new re for further cached usage\nParams is the table with the following fields (mandatory fields are marked with ",(0,d.jsx)(n.code,{children:"*"}),"):"]}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"re"}),"* : regular expression object"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"type"}),"*: type of regular expression:\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"mime"}),": mime regexp"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"rawmime"}),": raw mime regexp"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"header"}),": header regexp"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"rawheader"}),": raw header expression"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"body"}),": raw body regexp"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"url"}),": url regexp"]}),"\n"]}),"\n"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"header"}
1),": for header and rawheader regexp means the name of header"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"pcre_only"}),": flag regexp as pcre only regexp"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsx)(n.p,{children:"No return"}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"mf4b6d",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:replace_regexp(params)"})]}),"\n",(0,d.jsxs)(n.p,{children:["Replaces regexp with a new one\nParams is the table with the following fields (mandatory fields are marked with ",(0,d.jsx)(n.code,{children:"*"}),"):"]}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"old_re"}),"* : old regular expression object (must be in the cache)"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"new_re"}),"* : old regular expression object (must not be in the cache)"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsx)(n.p,{children:"No return"}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m3e1a3",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:register_regexp_scoped(scope, params)"})]}),"\n",(0,d.jsxs)(n.p,{children:["Registers new re for further cached usage in a specific scope\nParams is the table with the following fields (mandatory fields are marked with ",(0,d.jsx)(n.code,{children:"*"}),"):"]}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"re"}),"* : regular expression object"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"type"}),"*: type of regular expression:\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"mime"}),": mime regexp"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"rawmime"}),": raw mime regexp"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"header"}),": header regexp"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"rawheader"}),": raw header expression"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"body"}),": raw body regexp"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"url"}),": url regexp"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"selector"}),": selector regexp"]}),"\n"]}),"\n"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"header"}),": for header and rawheader regexp means the name of header"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"selector"}),": for selector regexp means selector name (registered in scope)"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"pcre_only"}),": flag regexp as pcre only regexp"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"scope {string}"}),": scope name for the regexp"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"params {table}"}),": regexp parameters"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsx)(n.p,{children:"No return"}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m6f106",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:replace_regexp_scoped(scope, params)"})]}),"\n",(0,d.jsxs)(n.p,{children:["Replaces regexp with a new one in a specific scope\nParams is the table with the following fields (mandatory fields are marked with ",(0,d.jsx)(n.code,{children:"*"}),"):"]}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"old_re"}),"* : old regular expression object (must be in the cache)"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"new_re"}),"* : old regular expression object (must not be in the cache)"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"pcre_only"}),": flag regexp as pcre only regexp"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"scope {string}"}),": scope name for the regexp"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"params {table}"}),": regexp parameters"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsx)(n.p,{children:"No return"}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m57fd2",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:register_re_selector_scoped(scope, name, selector_str, [delimiter, [flatten]])"})]}),"\n",(0,d.jsx)(n.p,{children:"Registers selector with the specific name in a specific scope to use in regular expressions"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"scope {string}"}),": scope name for the selector"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"name {string}"}),": name of the selector"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"selector_str {string}"}),": selector definition"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"delimiter {string}"}
1),": delimiter to use when joining strings if flatten is false"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"flatten {bool}"}),": if true then selector will return a table of captures instead of a single string"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:"true if selector has been registered"}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m6c96d",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:find_regexp_scope(scope)"})]}),"\n",(0,d.jsx)(n.p,{children:"Checks if a regexp scope exists"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"scope {string}"}),": scope name to check (can be nil for default scope)"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{boolean}"}),": true if scope exists"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m8ce8e",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:remove_regexp_scope(scope)"})]}),"\n",(0,d.jsx)(n.p,{children:"Removes a regexp scope from the cache"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"scope {string}"}),": scope name to remove"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{boolean}"}),": true if scope was removed successfully"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m1c4ae",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:count_regexp_scopes()"})]}),"\n",(0,d.jsx)(n.p,{children:"Returns the number of regexp scopes"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{number}"}),": number of scopes"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m38368",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:list_regexp_scopes()"})]}),"\n",(0,d.jsx)(n.p,{children:"Returns a list of all regexp scope names"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{table}"}),': array of scope names (default scope is named "default")']}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m2e707",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:set_regexp_scope_flags(scope, flags)"})]}),"\n",(0,d.jsx)(n.p,{children:"Sets flags for a regexp scope"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"scope {string}"}),": scope name (can be nil for default scope)"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"flags {number}"}),": flags to set"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsx)(n.p,{children:"No return"}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m875b0",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:clear_regexp_scope_flags(scope, flags)"})]}),"\n",(0,d.jsx)(n.p,{children:"Clears flags for a regexp scope"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"scope {string}"}),": scope name (can be nil for default scope)"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"flags {number}"}),": flags to clear"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsx)(n.p,{children:"No return"}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"mce146",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:get_regexp_scope_flags(scope)"})]}),"\n",(0,d.jsx)(n.p,{children:"Gets flags for a regexp scope"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"scope {string}"}),": scope name (can be nil for default scope)"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{number}"}),": current flags value"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m7f3f9",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:is_regexp_scope_loaded(scope)"})]}),"\n",(0,d.jsx)(n.p,{children:"Checks if a regexp scope is loaded and ready for use"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"scope {string}"}),": scope name (can be nil for default scope)"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{boolean}"}),": true if scope is loaded"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m31921",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:set_regexp_scope_loaded(scope, loaded)"})]}),"\n",(0,d.jsx)(n.p,{children:"Sets the loaded state of a regexp scope"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"scope {string}"}),": scope name (can be nil for default scope)"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"loaded {boolean}"}),": whether scope should be marked as loaded (defaults to true)"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsx)(n.p,{children:"No return"}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m98713",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:register_worker_script(worker_type, script)"})]}),"\n",(0,d.jsx)(n.p,{children:"Registers the following script for workers of a specified type. The exact type\nof script function depends on worker t
1ype"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"worker_type {string}"}),': worker type (e.g. "normal")']}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"script {function}"}),": script for a worker"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{boolean}"}),": ",(0,d.jsx)(n.code,{children:"true"})," if a script has been registered"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"me739e",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:add_on_load(function(cfg, ev_base, worker) ... end)"})]}),"\n",(0,d.jsx)(n.p,{children:"Registers the following script to be executed when configuration is completely loaded\nand the worker is already started (forked)"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"script {function}"}),": function to be executed"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsx)(n.p,{children:"No return"}),"\n",(0,d.jsx)(n.h3,{id:"example-11",children:"Example:"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-lua",children:'rspamd_config:add_on_load(function(cfg, ev_base, worker)\n\trspamd_config:add_periodic(ev_base, 1.0, function(cfg, ev_base)\n\t\tlocal logger = require "rspamd_logger"\n\t\tlogger.infox(cfg, "periodic function in worker %s", worker:get_name())\n\t\treturn true\n\tend)\nend)\n'})}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"mc71a3",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:add_periodic(event_base, timeout, function(cfg, ev_base) ... end, [jitter = false])"})]}),"\n",(0,d.jsx)(n.p,{children:"Registers function to be periodically executed by Rspamd"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"event_base {ev_base}"}),": event base that is needed for async events"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"timeout {number}"}),": time in seconds (could be fractional)"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"script {function}"}),": function to be executed"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"jitter {boolean}"}),": ",(0,d.jsx)(n.code,{children:"true"})," if timeout jittering is needed"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsx)(n.p,{children:"No return"}),"\n",(0,d.jsx)(n.h3,{id:"example-12",children:"Example:"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-lua",children:'rspamd_config:add_on_load(function(cfg, ev_base)\n\trspamd_config:add_periodic(ev_base, 1.0, function(cfg, ev_base)\n\t\tlocal logger = require "rspamd_logger"\n\t\tlogger.infox(cfg, "periodic function")\n\t\treturn true -- if return numeric, a new interval is set. if return false, then the periodic event is removed\n\tend)\nend)\n'})}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"mb617c",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:add_post_init(function(cfg) ... end)"})]}),"\n",(0,d.jsx)(n.p,{children:"Registers the following script to be executed when configuration is completely loaded"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"script {function}"}),": function to be executed"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsx)(n.p,{children:"No return"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"Available in:"})," 2.0+"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"mc6e68",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:add_config_unload(function(cfg) ... end)"})]}),"\n",(0,d.jsx)(n.p,{children:"Registers the following script to be executed when configuration is unloaded"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"script {function}"}),": function to be executed"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsx)(n.p,{children:"No return"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"Available in:"})," 2.0+"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m0e0cd",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:get_symbols_count()"})]}),"\n",(0,d.jsx)(n.p,{children:"Returns number of symbols registered in rspamd configuration"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{number}"}),": number of symbols registered in the configuration"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"mbadba",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:get_symbols_cksum()"})]}),"\n",(0,d.jsx)(n.p,{children:"Returns checksum for all symbols in the cache"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{int64}"}
1),": boxed value of the 64 bit checksum"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"ma379f",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:get_symbols_counters()"})]}),"\n",(0,d.jsx)(n.p,{children:"Returns table of all counters in the cache (weights, frequencies etc)"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{table|tables}"}),": all symbols indexed by name"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"mfa49c",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:get_symbols()"})]}),"\n",(0,d.jsx)(n.p,{children:"Returns table of all scores defined in config. From version 2.0 returns table:"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:"name"}),"\n",(0,d.jsx)(n.li,{children:"score"}),"\n",(0,d.jsxs)(n.li,{children:["flags (e.g. ",(0,d.jsx)(n.code,{children:"ignore"})," or ",(0,d.jsx)(n.code,{children:"oneparam"}),")"]}),"\n",(0,d.jsx)(n.li,{children:"nshots (== maxhits)"}),"\n",(0,d.jsx)(n.li,{children:"group - main group"}),"\n",(0,d.jsx)(n.li,{children:"groups - array of all groups"}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{table|tables}"}),": all symbols indexed by name"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"Available in:"})," 2.0+"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m025f5",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:get_symbol(sym_name)"})]}),"\n",(0,d.jsx)(n.p,{children:"Returns table for a specific symbol getting data from the static config:"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:"name"}),"\n",(0,d.jsx)(n.li,{children:"score"}),"\n",(0,d.jsxs)(n.li,{children:["flags (e.g. ",(0,d.jsx)(n.code,{children:"ignore"})," or ",(0,d.jsx)(n.code,{children:"oneparam"}),")"]}),"\n",(0,d.jsx)(n.li,{children:"nshots (== maxhits)"}),"\n",(0,d.jsx)(n.li,{children:"group - main group"}),"\n",(0,d.jsx)(n.li,{children:"groups - array of all groups"}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{table}"}),": symbol data (or nil)"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"Available in:"})," 3.3+"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m6f5be",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:get_symbol_callback(name)"})]}),"\n",(0,d.jsx)(n.p,{children:"Returns callback function for the specified symbol if it is a lua registered callback"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{function}"}),": callback function or nil"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m6016e",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:get_symbol_stat(name)"})]}),"\n",(0,d.jsx)(n.p,{children:"Returns table with statistics for a specific symbol:"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"frequency"}),": frequency for symbol's hits"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"stddev"}),": standard deviation of ",(0,d.jsx)(n.code,{children:"frequency"})]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"time"}),": average time in seconds (floating point)"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"count"}),": total number of hits"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{table}"}),": symbol stats"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m3b08d",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:set_symbol_callback(name, callback)"})]}),"\n",(0,d.jsx)(n.p,{children:"Sets callback for the specified symbol"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{boolean}"}),": true if function has been replaced"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"meec0c",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:register_finish_script(callback)"})]}),"\n",(0,d.jsx)(n.p,{children:"Adds new callback that is called on worker process termination when all\ntasks pending are processed"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"callback {no type}"}),": {function} a function with one argument (rspamd_task)"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsx)(n.p,{children:"No return"}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"meb722",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:register_monitored(url, type, [{params}])"})]}),"\n",(0,d.jsx)(n.p,{children:"Registers monitored resource to watch its availability. Supported types:"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"dns"}),": DNS monitored object"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:"Params are optional table specific for each type. For DNS it supports the\nfollowing options:"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"prefix"}),": prefix to add before making request"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"type"}),": type of request (e.g. 'a' or 'txt')"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"ipnet"}),": array of ip/networks to expect on reply"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"rcode"}),": expected return code (e.g. ",(0,d.jsx)(n.code,{children:"nxdomain"}),")"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:"Returned object has the following methods:"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"alive"}),": returns ",(0,d.jsx)(n.code,{children:"true"})," if monitored resource is alive"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"offline"}
1),": returns number of seconds of the current offline period (or 0 if alive)"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"total_offline"}),": returns number of seconds of the overall offline"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"latency"}),": returns the current average latency in seconds (or 0 if offline)"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"url {string}"}),": resource to monitor"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"type {string}"}),": type of monitoring"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"opts {table}"}),": optional parameters"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{rspamd_monitored}"}),": rspamd monitored object"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m0e9a6",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:add_doc(path, option, doc_string, [{params}])"})]}),"\n",(0,d.jsxs)(n.p,{children:["Adds new documentation string for an option ",(0,d.jsx)(n.code,{children:"option"})," at path ",(0,d.jsx)(n.code,{children:"path"}),"\nOptions defines optional params, such as:"]}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"default"}),": default option value"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"type"}),": type of an option (",(0,d.jsx)(n.code,{children:"string"}),", ",(0,d.jsx)(n.code,{children:"number"}),", ",(0,d.jsx)(n.code,{children:"object"}),", ",(0,d.jsx)(n.code,{children:"array"})," etc)"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"required"}),": if an option is required"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"path {string}"}),": documentation path (e.g. module name)"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"option {string}"}),": name of the option"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"doc_string {string}"}),": documentation string"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"params {table}"}),": optional parameters"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsx)(n.p,{children:"No return"}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"mf6643",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:add_example(path, option, doc_string, example)"})]}),"\n",(0,d.jsx)(n.p,{children:"Adds new documentation"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"path {string}"}),": documentation path (e.g. module name or nil for top)"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"option {string}"}),": name of the option"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"doc_string {string}"}),": documentation string"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"example {string}"}),": example in ucl format, comments are also parsed"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsx)(n.p,{children:"No return"}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m22ff8",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:set_peak_cb(function)"})]}),"\n",(0,d.jsx)(n.p,{children:"Sets a function that will be called when frequency of some symbol goes out of\nstddev * 2 over the last period of refreshment."}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsx)(n.p,{children:"No return"}),"\n",(0,d.jsx)(n.h3,{id:"example-13",children:"Example:"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-lua",children:'rspamd_config:set_peak_cb(function(ev_base, sym, mean, stddev, value, error)\n -- ev_base: event base for async events (e.g. redis)\n -- sym: symbol\'s name\n -- mean: mean frequency value\
1n -- stddev: standard deviation of frequency\n -- value: current frequency value\n -- error: squared error\n local logger = require "rspamd_logger"\n logger.infox(rspamd_config, "symbol %s has changed frequency significantly: %s(%s) over %s(%s)",\n sym, value, error, mean, stddev)\nend)\n'})}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"mfee9b",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:get_cpu_flags()"})]}),"\n",(0,d.jsx)(n.p,{children:"Returns architecture dependent flags supported by the CPU\nCurrently, only x86 flags are supported:"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:"'ssse3'"}),"\n",(0,d.jsx)(n.li,{children:"'sse42'"}),"\n",(0,d.jsx)(n.li,{children:"'avx'"}),"\n",(0,d.jsx)(n.li,{children:"'avx2'"}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{table}"}),": flag -> true table"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m05fc7",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:has_torch()"})]}),"\n",(0,d.jsx)(n.p,{children:"Returns true if Rspamd is compiled with torch support and the runtime CPU\nsupports sse4.2 required for torch."}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{boolean}"}),": true if torch is compiled and supported"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m0620e",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:is_mime_utf8()"})]}),"\n",(0,d.jsx)(n.p,{children:"Returns true if Rspamd is configured to use UTF for mime processing"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{boolean}"}),": true if mime utf is enabled"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m49da1",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:experimental_enabled()"})]}),"\n",(0,d.jsx)(n.p,{children:"Returns true if experimental plugins are enabled"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{boolean}"}),": true if experimental plugins are enabled"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m05ea1",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:load_ucl(filename[, include_trace])"})]}),"\n",(0,d.jsx)(n.p,{children:"Loads config from the UCL file (but does not perform parsing using rcl)"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"filename {string}"}),": file to load"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:"true or false + error message"}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m02350",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:parse_rcl([skip_sections])"})]}),"\n",(0,d.jsx)(n.p,{children:"Parses RCL using loaded ucl file"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"sections {table|string}"}),": to skip"]}
1),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:"true or false + error message"}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"mffb1c",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:init_modules()"})]}),"\n",(0,d.jsx)(n.p,{children:"Initialize lua and internal modules"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:"true or false"}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m32fef",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:init_subsystem(str)"})]}),"\n",(0,d.jsx)(n.p,{children:"Initialize config subsystem from a comma separated list:"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"modules"})," - init modules"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"langdet"})," - language detector"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"dns"})," - DNS resolver"]}),"\n",(0,d.jsx)(n.li,{children:"TODO: add more"}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsx)(n.p,{children:"No return"}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m4f77b",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:get_tld_path()"})]}),"\n",(0,d.jsx)(n.p,{children:"Returns path to TLD file"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{string}"}),": path to tld file"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m226f2",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:get_dns_max_requests()"})]}),"\n",(0,d.jsx)(n.p,{children:"Returns limit of DNS requests per task"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{number}"}),": number of dns requests allowed"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"mb323b",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:get_dns_timeout()"})]}),"\n",(0,d.jsx)(n.p,{children:"Returns timeout for a DNS request"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{number}"}),": DNS timeout in second or 0 if not defined"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m6a340",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:load_custom_tokenizers()"})]}),"\n",(0,d.jsx)(n.p,{children:"Loads custom tokenizers from configuration"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"{boolean}"}),": true if successful"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.h3,{id:"m4f2a9",children:["Method ",(0,d.jsx)(n.code,{children:"rspamd_config:unload_custom_tokenizers()"})]}),"\n",(0,d.jsx)(n.p,{children:"Unloads custom tokenizers and frees memory"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,d.jsx)(n.p,{children:"No parameters"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,d.jsx)(n.p,{children:"No return"}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#mb0614",children:"module description"}),"."]}),"\n",(0,d.jsxs)(n.p,{children:["Back to ",(0,d.jsx)(n.a,{href:"#",children:"top"}),"."]})]})}function h(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,d.jsx)(n,{...e,children:(0,d.jsx)(a,{...e})}):a(e)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.