[Rspamd-Users] Multimap - Map content

Gerald Galster list+rspamd at gcore.biz
Thu Jun 6 13:03:34 UTC 2024


> I came across "Map content" in the multimap documentation.
> How can I understand that? Is it possible to add a special scoring to a term?
> 
> One of my maps contains spam terms:
> Armut\sim\sRuhestand
> Durchführung\svon\sTrades
> First\spage\son\sGoogle
> 
> Can I add scores to each one individually?

Yes.

local.d/multimap.conf:

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

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

/Trades/ BODY_SPAM:0.12
/Armut\sim\sRuhestand/ BODY_SPAM:5.82

-> any occurrence of Trades adds 0.12 points
-> the line below adds 5.82 points


> I don't understand the description:
> key1 value1
> key2 value2
> key3 value3:score

Try it this way:

1) key
2) key symbol
3) key symbol:score

Currently you seem to use 1).

1) Your map contains keys (in this case regexes) only

   /Armut\sim\sRuhestand/

2) You could also set a symbol

   /Armut\sim\sRuhestand/ BODY_SPAM
   /Bitcoin\sim\sRuhestand/ BITCOIN_SPAM

   You define which symbols are allowed in multimap.conf, see:
   https://rspamd.com/doc/modules/multimap.html#multiple-symbol-maps
   
3) You could set a symbol and a score

   /Armut\sim\sRuhestand/ BODY_SPAM:5.82
   /Trades/ BODY_SPAM:0.12

   This is very useful. You can set a higher score for terms found in
   spam only.

1) and 2) use the score set in multimap.conf/metrics.conf (or default score).
   
Best regards,
Gerald



More information about the Users mailing list