[Rspamd-Users] New Symbol creation

Gerald Galster list+rspamd at gcore.biz
Sun Jul 7 22:50:06 UTC 2024


> I'm a little confused when it comes to the documentation around symbols.  If
> I wanted to create a new symbol where do I need to put it ?
> 
> I have the symbol mentioned in the mulitmap under the map that I am looking
> for it to be used in.  
> 
> But it shows up as 0 regardless of what I do.

Try this:

----------------------------------------------------------
local.d/multimap.conf:

BODY_SPAM {
	type = "content";
	filter = "oneline";
	map = "file:///etc/rspamd/local.d/body_spam.map";
	multi = true;
	regexp = true;
	score = 1.0;
}

/etc/rspamd/local.d/body_spam.map:

/Trades/ BODY_SPAM:0.12
/this_is_spam/ BODY_SPAM:5.82
----------------------------------------------------------

Send an email containing those words and watch your rspamd.log.
Look for lines including rspamd_task_write_log, you should see
BODY_SPAM there.


The symbol is BODY_SPAM. It won't work if you comment out
the line with "score = 1.0;", unless you define BODY_SPAM in
metrics.conf (deprecated) or groups.conf.
https://rspamd.com/doc/developers/writing_rules.html#rule-weights

You can use the symbol BODY_SPAM in other places like force_action.conf.


> I have also tried swapping out score = 25.0 with weight = 25.0 (just to try)
> but I don't think that's the issue.

See https://lists.rspamd.com/pipermail/users/2024-June/003316.html


> On one page in the manual, I saw mention of rspamd_config:register_symbol
> , which somewhat leads me to believe that I need to register it, but I can't
> igure out where that config should be placed.  

You may have read about lua rules but this is not needed for multimaps.

Best regards,
Gerald





More information about the Users mailing list