[Rspamd-Users] header checks with regexp to add +score via multimap

C. Bernard rspamd_users_ml at cmb.ch
Tue Apr 22 13:32:55 UTC 2025


Hi Florian

On 2025-04-22 14:36, Florian Piekert via Users wrote:
> Hello all,
> 
> 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;
> }
> 
> or
> header="regexp:/re/";
> with
> 
> /X\-Google\-Group\-Id/
> 
> in the blacklist.header_soft_regexp.map file.
> 
> What is the correct way to achieve what I try to?
> 
> Florian

The regex ist for the contents of an item and not the item itself. Can 
you try something like this:

SUBJECT_SOFT_BLACK_HEADER_REGEX {
  type = "header";
  header = "X-Google-Group-Id";
  regexp = true;
  map = "$LOCAL_CONFDIR/local.d/blacklist.header_soft_regexp.map";
  symbol = "SUBJECT_SOFT_BLACK_HEADER_REGEX";
  score = 5.0;
}

with $LOCAL_CONFDIR/local.d/blacklist.header_soft_regexp.map
/*/


Cheers
Christian
PS: Maybe there is a way to check just "if there is a header" or not 
instead of "there is a header" with this regex as "value".



More information about the Users mailing list