[Rspamd-Users] New Symbol creation

Dave - MailingLists dlewis at dsl-co.com
Thu Jul 11 23:37:29 UTC 2024


interesting.  
So I added your sample to my ./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;
}

And then added the entries to the .map file

root at mail:/etc/rspamd/local.d# cat /etc/rspamd/local.d/body_spam.map
/Trades/ BODY_SPAM:0.12
/this_is_spam/ BODY_SPAM:5.82

I even restarted rpsamd to be safe, 

Yet the response of an email with the text in it doesn't show the new symbol
in the log file.

Looking from the gui I don't see it in the breakdown of the message either.

HTML_SHORT_LINK_IMG_1 (1.8)
URI_COUNT_ODD (1) [5]
DMARC_POLICY_ALLOW (-0.5) [gmail.com,none]
RCVD_IN_DNSWL_HI (-0.5) [179.210.85.209.list.dnswl.org : 127.0.10.3]
R_SPF_ALLOW (-0.2) [+ip4:209.85.128.0/17]
MIME_GOOD (-0.1) [multipart/alternative,text/plain]
MX_GOOD (-0.01) [cached: alt3.gmail-smtp-in.l.google.com]
TO_DN_ALL (0)
FREEMAIL_FROM (0) [gmail.com]
RCVD_COUNT_TWO (0) [2]
IP_SCORE (0) [ipnet: 209.85.128.0/17(-4.66), asn: 15169(-3.73), country:
US(-0.02)]
RWL_MAILSPIKE_GOOD (0) [179.210.85.209.rep.mailspike.net : 127.0.0.18]
PREVIOUSLY_DELIVERED (0) [dave at xxxx.com]
FREEMAIL_ENVFROM (0) [gmail.com]
ARC_NA (0)
NEURAL_HAM (0) [-0.922,0]
IP_SCORE_FREEMAIL (0)
FROM_EQ_ENVFROM (0)
FROM_HAS_DN (0)
TAGGED_FROM (0)
RCPT_COUNT_ONE (0) [1]
MIME_TRACE (0) [0:+,1:+,2:~]
TO_MATCH_ENVRCPT_ALL (0)
RCVD_TLS_ALL (0)
ASN (0) [asn:15169, ipnet:209.85.128.0/17, country:US]

It's like it just doesn't read the config or something .

Dave

-----Original Message-----
From: Users <users-bounces at lists.rspamd.com> On Behalf Of Gerald Galster
Sent: Sunday, July 7, 2024 6:50 PM
To: User questions <users at lists.rspamd.com>
Subject: Re: [Rspamd-Users] New Symbol creation


> 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



--
Users mailing list
Users at lists.rspamd.com
https://lists.rspamd.com/mailman/listinfo/users


-- 
This email has been checked for viruses by Avast antivirus software.
www.avast.com


More information about the Users mailing list