[Rspamd-Users] How to reject email subject/body message?

Gerald Galster list+rspamd at gcore.biz
Fri Oct 20 21:22:04 UTC 2023


> I'm relatively new to spam filtering systems.
> Could somebody please point me to the documentation or give an example of how to perform the following actions:
> - Reject an email with specific text in a body message.
> - Reject an email with specific text in a subject.

See https://rspamd.com/doc/modules/multimap.html
 
1) define a new map

/etc/rspamd/local.d/multimap.conf:

MMAP_BLOCK_SUBJ {
  type = "header";
  header = "Subject";
  map = "file:///etc/rspamd/local.d/maps.d/multimap_block_subject";
  multi = true;
  regexp = true;
}

2) create a metrics entry for that symbol

/etc/rspamd/local.d/metrics.conf

symbol "MMAP_BLOCK_SUBJ" {
  weight = 1.0;
}

3) add regular expressions to the map file /etc/rspamd/local.d/maps.d/multimap_block_subject:

/part of subject/ MMAP_BLOCK_SUBJ:2.0
/confirm if .*? still valid/ MMAP_BLOCK_SUBJ:3.2
...
Format is:
/<regex>/ SYMBOL_NAME:SCORE

Restart rspamd. After initial setup rspamd detects changes and reloads the map automatically.

If score is high enough, messages will be learned as spam and rejected.

Best regards,
Gerald



More information about the Users mailing list