[Rspamd-Users] header checks with regexp to add +score via multimap
Florian Piekert
floppy at floppy.org
Tue Apr 22 13:52:22 UTC 2025
Hello Ged and all others,
>> I am sick of those google groups spam messages and want to give all messages that have the
>>
>> X-Google-Group-Id:
>>
>> Header entry a +5 penalty in its scoring.
>>
>> But how.
>>
>> I tried
>>
>> SUBJECT_SOFT_BLACK_HEADER_REGEX {
>> type = "header";
>> header = "regexp:/^X\-Google\-Group\-Id:*$/";
>> regexp = true;
>> map = "$LOCAL_CONFDIR/local.d/blacklist.header_soft_regexp.map";
>> score = 5.0;
>> }
>> ...
>
> Your regex requires that zero or more colons (and no other characters)
> appear between the character 'd' in "Id" and the end of the line. If
> I understand what you're trying to do with that regex, you need a dot
> before the asterisk to match any number of any characters between the
> colon and the end of the line.
>
Got that with the .* and \: additionally.
However, why do I need a map file at all. If I omitt it, rspamadm configtest refuses.
rspamadm configtest && touch /etc/rspamd/.reload_needed && touch /etc/rspamd/local.d/.reload_needed
incomplete rule, missing map
cannot add rule: "SUBJECT_SOFT_BLACK_HEADER_REGEX"
syntax OK
So that brought the question, how to define it correctly. Why the map file if the regexp in the definition itself is all-encompassing for my goal?
Florian
More information about the Users
mailing list