Skip to content

martinschaible/rspamd-rules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Curated Multimaps for Rspamd, second edition

Rspamd offers so-called multimaps and their maps. With them you can create rules with or without regular expressions.

I started developing the rules in early 2024 and i am now working on an improved second version.

Before Rspamd, I used an older product called Declude as a spam filtering system for our server as well as for customers. Declude also offered a rule system based on regular expressions. This experience is very useful to me here.

πŸ’‘ The rules are updated at least once, but usually several times a day and are therefore sure to be accurate.

πŸ“’ If you have any questions or feedback drop me line at the discussions.

πŸ› Bugs and problems can be reported here: Issues.

πŸ€ Feel free to use these maps on your Rspamd server.

Installation

The base is the file multimaps.conf in the folder /etc/rspamd/local.d. This file includes all configuration files of the map files. These files are located in the same folder and must also be copied to the server.

The map files of the first generation begin with an underscore _multimap....map. The second generation does not have the leading underscore.

Important: To be as effective as possible, both versions must be active until the migration is complete.

Finally, the Rspamd service must be restarted

systemctl restart rspamd

The map files in the folder /etc/rspamd/maps.d do not need to be copied. Rspamd loads them directly from Github and caches them locally. New versions are checked periodically.

Updates configuration files

If I add new map files, the configuration files must be updated accordingly. These are the latest changes:

Date File Reason
09.05.25 multimap.subject.conf New file for Emojis
10.05.25 All configuration files! Splitted in DE and EN versions
13.05.25 multimap.conf New files added, old files removed
multimap.body.de.scam.conf New file
multimap.body.en.scam.conf New file
multimap.body.de.stocks.conf New file
multimap.body.en.stocks.conf New file
_multimap_stocks.conf Old file deleted
_multimap_winning.conf Old file deleted
14.05.25 multimap.whitelist.conf Three silly typos fixed
16.05.25 multimap.sender.conf New map file added
17.05.25 multimap.subject.de.phishing.conf New map file added
multimap.subject.en.phishing.conf New map file added
26.05.25 multimap.conf New files added
multimap.subject.de.stocks.conf New file
multimap.subject.en.stocks.conf New file
27.05.25 multimap.conf New configuration files added
multimap.body.de.sale.conf New file
multimap.body.en.sale.conf New file
_multimap_base_phrases.conf Old map files retired/removed
28.05.25 multimap.subject.de.sale.conf New map file added
multimap.subject.en.sale.conf New map file added
29.05.25 multimap.conf New configuration files added
multimap.body.de.phishing.conf New file
multimap.body.en.phishing.conf New file
29.05.25 multimap.conf Old files removed
_multimap_ad.conf Old file deleted
_multimap_domain.conf Old file deleted

Attention: A major migration of the configuration files is necessary: The naming of the "Sender" files was unfortunate and has now been corrected. New configuration files have also been added.

Date File Reason
03.06.25 multimap.conf New configuration files added
multimap.sender.address.conf New file
multimap.sender.address.de.conf New file
multimap.sender.address.en.conf New file
multimap.sender.from.de.*.conf New files
multimap.sender.from.en.*.conf New files
multimap.sender.de.*.conf Old file deleted/renamed
multimap.sender.en.*.conf Old file deleted/renamed
04.06.25 multimap.subject.de.scam.conf New map file added
multimap.subject.en.scam.conf New map file added
multimap.body.de.scam.conf New map file added
multimap.body.en.scam.conf New map file added
07.06.25 multimap.body.de.scam.conf Typo fixed
multimap.body.en.scam.conf Typo fixed
multimap.sender.from.conf New map file added
08.06.25 multimap.sender.from.phishing.conf New map file added
09.06.25 multimap.body.de.sale.conf New map files added
multimap.body.en.sale.conf New map files added
10.06.25 multimap.body.de.sale.conf New map file added
multimap.body.en.sale.conf New map file added
multimap.sender.from Typo fixed
13.06.25 multimap.body.de.scam.conf New map file added
multimap.body.en.scam.conf New map file added

What to do:

  • Copy these files to the Rspamd server
  • Restart the Rspamd service

Content

All map files of the first version are in the folder /etc/rspamd/maps.d. The files of the second edition are stored in subfolders according to the topic.

Setup for "base"

Folder structure:

base
  β”œβ”€ base.country.map                            ─┐
  β”œβ”€ base.body.charenc.koi8r.map              *   β”‚
  β”œβ”€ base.body.charenc.windows1251.map        *   β”œβ”€ multimap.base.conf
  β”œβ”€ base.body.markup.hidden.map                  β”‚
  β”œβ”€ base.body.markup.map                        β”€β”˜
  β”‚
  β”œβ”€ href
  β”‚   β”œβ”€ base.body.href.domain.map            *  ─┐
  β”‚   β”œβ”€ base.body.href.domain.ip.map         *   β”‚
  β”‚   β”œβ”€ base.body.href.domain.google.map     *   β”‚
  β”‚   β”œβ”€ base.body.href.nossl.map             *   β”œβ”€ multimap.base.body.href.conf
  β”‚   β”œβ”€ base.body.href.path.map              *   β”‚
  β”‚   β”œβ”€ base.body.href.path.filename.map     *   β”‚
  β”‚   └─ base.body.href.path.wordpress.map    *  β”€β”˜
  β”‚
  └─ img
      β”œβ”€ base.body.img.domain.ip.map          *  ─┐
      β”œβ”€ base.body.img.domain.tld.map         *   β”‚
      β”œβ”€ base.body.img.domain.name.map        *   β”œβ”€ multimap.base.body.img.conf
      β”œβ”€ base.body.img.nossl.map              *   β”‚
      β”œβ”€ base.body.img.path.map               *   β”‚
      └─ base.body.img.shortener.map          *  β”€β”˜

lists
  β”œβ”€ list.tld.map                             *  --- multimap.base.body.href.conf
  └─ list.url.shortener.map                   *  --- multimap.base.body.href.conf
  • -> "one_shot" is set

Setup for "body"

Folder structure:

body
  β”œβ”€ body.attachment.map                         ─┐
  β”œβ”€ body.emergency.map                           β”‚
  β”œβ”€ body.special.map                             β”‚
  β”‚                                               β”‚
  β”œβ”€ body.az.orgname.map                          β”œβ”€ multimap.body.conf
  β”œβ”€ body.ch.orgname.map                          β”‚
  β”œβ”€ body.de.orgname.map                          β”‚
  β”œβ”€ body.us.orgname.map                         β”€β”˜
  β”‚
  β”œβ”€ href
  β”‚   β”œβ”€ body.href.az.domain.name.map            ─┐
  β”‚   β”œβ”€ body.href.ch.domain.name.map             β”‚
  β”‚   β”œβ”€ body.href.de.domain.name.map             β”œβ”€ multimap.body.href.conf
  β”‚   β”œβ”€ body.href.us.domain.name.map             β”‚
  β”‚   β”œβ”€ body.href.domain.name.pattern.map        β”‚
  β”‚   └─ body.href.url.path.orgbrandprod.map     β”€β”˜
  β”‚
  β”œβ”€ de
  β”‚   β”œβ”€ body.de.map                             ─┐
  β”‚   β”œβ”€ body.de.greetings.map                    β”‚
  β”‚   β”œβ”€ body.de.intros.map                       β”‚
  β”‚   β”œβ”€ body.de.message.map                      β”œβ”€ multimap.body.de.conf
  β”‚   β”œβ”€ body.de.singleword.map                   β”‚
  β”‚   β”œβ”€ body.de.singleword.ucase.map             β”‚
  β”‚   β”œβ”€ body.de.unsubscribe.map                 β”€β”˜
  β”‚   β”‚
  β”‚   β”œβ”€ body.de.phishing.map                    ─┐
  β”‚   β”œβ”€ body.de.phishing.account.map             β”‚
  β”‚   β”œβ”€ body.de.phishing.alertaction.map         β”‚
  β”‚   β”œβ”€ body.de.phishing.banking.map             β”‚
  β”‚   β”œβ”€ body.de.phishing.email.map               β”‚
  β”‚   β”œβ”€ body.de.phishing.greetings.map           β”‚
  β”‚   β”œβ”€ body.de.phishing.malware.map             β”‚
  β”‚   β”œβ”€ body.de.phishing.parcel.map              β”œβ”€ multimap.body.de.phishing.conf
  β”‚   β”œβ”€ body.de.phishing.password.map            β”‚
  β”‚   β”œβ”€ body.de.phishing.payment.map             β”‚
  β”‚   β”œβ”€ body.de.phishing.refund.map              β”‚
  β”‚   β”œβ”€ body.de.phishing.rewards.map             β”‚
  β”‚   β”œβ”€ body.de.phishing.subscription.map        β”‚
  β”‚   β”œβ”€ body.de.phishing.survey.map             β”€β”˜
  β”‚   β”‚
  β”‚   β”œβ”€ body.de.sale.map                        ─┐
  β”‚   β”œβ”€ body.de.sale.app.map                     β”‚
  β”‚   β”œβ”€ body.de.sale.greetings.map               β”‚
  β”‚   β”œβ”€ body.de.sale.china.map                   β”œβ”€ multimap.body.de.sale.conf
  β”‚   β”œβ”€ body.de.sale.media.map                   β”‚
  β”‚   β”œβ”€ body.de.sale.seo.map                     β”‚
  β”‚   β”œβ”€ body.de.sale.website.map                β”€β”˜
  β”‚   β”‚
  β”‚   β”œβ”€ body.de.stocks.map                      --- multimap.body.de.stocks.conf
  β”‚   β”‚
  β”‚   β”œβ”€ body.de.scam.map                        ─┐
  β”‚   β”œβ”€ body.de.scam.business.map                β”‚
  β”‚   β”œβ”€ body.de.scam.bignumbers.map              β”‚
  β”‚   β”œβ”€ body.de.scam.donations.map               β”‚
  β”‚   β”œβ”€ body.de.scam.investment.map              β”œβ”€ multimap.body.de.scam.conf
  β”‚   β”œβ”€ body.de.scam.order.map                   β”‚
  β”‚   β”œβ”€ body.de.scam.payment.map                 β”‚
  β”‚   β”œβ”€ body.de.scam.ransom.map                  β”‚
  β”‚   └─ body.de.scam.winning.map                β”€β”˜
  β”‚
  └─ en
      └─ ....

Setup for "sender"

Folder structure:

sender
  β”œβ”€ sender.address.map                          ─┐
  β”œβ”€ sender.address.orgbrandprod.map              β”œβ”€ multimap.sender.address.conf
  β”œβ”€ sender.address.people.map                    β”‚
  β”œβ”€ sender.address.tld                          β”€β”˜
  β”‚
  β”œβ”€ de
  β”‚   └─ sender.address.de.map                   --- multimap.sender.address.de.conf 
  β”‚
  β”œβ”€ sender.from.phishing.orgbrandprod.map       --- multimap.sender.from.phishing.conf
  β”œβ”€ sender.from.phishing.orgbrandprod.ucase.map --- multimap.sender.from.phishing.conf
  β”‚
  β”œβ”€ sender.from.orgbrandprod.map                ─┐
  β”œβ”€ sender.from.people.map                       β”œβ”€ multimap.sender.from.conf
  β”œβ”€ sender.from.special.map                      β”‚
  β”œβ”€ sender.from.title.map                       β”€β”˜
  β”‚
  β”œβ”€ de
  β”‚   β”œβ”€ sender.from.de.singleword.map           --- multimap.sender.from.de.conf
  β”‚   β”œβ”€ sender.from.de.singleword.ucase.map     --- multimap.sender.from.de.conf
  β”‚   β”‚
  β”‚   β”œβ”€ sender.from.de.map                      --- multimap.sender.from.de.conf 
  β”‚   β”œβ”€ sender.from.de.adult.map                --- multimap.sender.from.de.adult.conf
  β”‚   β”œβ”€ sender.from.de.finance.map              --- multimap.sender.from.de.finance.conf
  β”‚   β”œβ”€ sender.from.de.gambling.map             --- multimap.sender.from.de.gambling.conf
  β”‚   β”œβ”€ sender.from.de.health.map               --- multimap.sender.from.de.health.conf
  β”‚   β”œβ”€ sender.from.de.lottery.map              --- multimap.sender.from.de.lottery.conf
  β”‚   β”œβ”€ sender.from.de.makemoney.map            --- multimap.sender.from.de.makemoney.conf
  β”‚   β”œβ”€ sender.from.de.phishing.map             --- multimap.sender.from.de.phishing.conf
  β”‚   β”œβ”€ sender.from.de.phishing.malware.map     --- multimap.sender.from.de.phishing.malware.conf
  β”‚   └─ sender.from.de.sale.map                 --- multimap.sender.from.de.sale.conf
  β”‚
  └─ en
      └─ ....

Setup for "subject"

Folder structure:

subject  
  β”œβ”€ subject.health.medname.map                  --- multimap.subject.health.conf
  β”œβ”€ subject.orgbrandprod.map                    ─┐
  β”œβ”€ subject.special.map                          β”œβ”€ multimap.subject.conf
  β”œβ”€ subject.special.emoji.map                   β”€β”˜
  β”‚
  β”œβ”€ de
  β”‚   β”œβ”€ subject.de.map                          ─┐  
  β”‚   β”œβ”€ subject.de.greetings.map                 β”‚
  β”‚   β”œβ”€ subject.de.message.map                   β”œβ”€ multimap.subject.de.conf
  β”‚   β”œβ”€ subject.de.singleword.map                β”‚
  β”‚   β”œβ”€ subject.de.singleword.ucase.map         β”€β”˜
  β”‚   β”‚
  β”‚   β”œβ”€ subject.de.adult.map                    --- multimap.subject.de.adult.conf
  β”‚   β”œβ”€ subject.de.finance.map                  --- multimap.subject.de.finance.conf
  β”‚   β”œβ”€ subject.de.gambling.map                 --- multimap.subject.de.gambling.conf
  β”‚   β”œβ”€ subject.de.health.map                   --- multimap.subject.de.health.conf
  β”‚   β”‚
  β”‚   β”œβ”€ subject.de.phishing.map                 ─┐
  β”‚   β”œβ”€ subject.de.phishing.account.map          β”‚
  β”‚   β”œβ”€ subject.de.phishing.alertaction.map      β”‚
  β”‚   β”œβ”€ subject.de.phishing.banking.map          β”‚
  β”‚   β”œβ”€ subject.de.phishing.email.map            β”‚
  β”‚   β”œβ”€ subject.de.phishing.malware.map          β”‚
  β”‚   β”œβ”€ subject.de.phishing.parcel.map           β”‚
  β”‚   β”œβ”€ subject.de.phishing.password.map         β”œβ”€ multimap.subject.de.phishing.conf
  β”‚   β”œβ”€ subject.de.phishing.payment.map          β”‚
  β”‚   β”œβ”€ subject.de.phishing.refund.map           β”‚
  β”‚   β”œβ”€ subject.de.phishing.rewards.map          β”‚
  β”‚   β”œβ”€ subject.de.phishing.subscription.map     β”‚
  β”‚   β”œβ”€ subject.de.phishing.survey.map          β”€β”˜
  β”‚   β”‚
  β”‚   β”œβ”€ subject.de.sale.map                     ─┐
  β”‚   β”œβ”€ subject.de.sale.app.map                  β”‚
  β”‚   β”œβ”€ subject.de.sale.china.map                β”‚
  β”‚   β”œβ”€ subject.de.sale.media.map                β”œβ”€ multimap.subject.de.sale.conf
  β”‚   β”œβ”€ subject.de.sale.seo.map                  β”‚
  β”‚   β”œβ”€ subject.de.sale.website.map             β”€β”˜
  β”‚   β”‚
  β”‚   β”œβ”€ subject.de.scam.map                     ─┐
  β”‚   β”œβ”€ subject.de.scam.bignumbers.map           β”‚
  β”‚   β”œβ”€ subject.de.scam.business.map             β”‚
  β”‚   β”œβ”€ subject.de.scam.donation.map             β”œβ”€ multimap.subject.de.scam.conf
  β”‚   β”œβ”€ subject.de.scam.investment.map    *      β”‚
  β”‚   β”œβ”€ subject.de.scam.order.map                β”‚
  β”‚   β”œβ”€ subject.de.scam.payment.map              β”‚
  β”‚   β”œβ”€ subject.de.scam.winning.map             β”€β”˜
  β”‚   β”‚
  β”‚   └─ subject.de.stocks.map                   --- multimap.subject.de.stocks.conf
  β”‚
  └─ en
      └─ ....

Setup for "whitelist"

Folder structure:

whitelist
  β”œβ”€ body.href.url.az.whitelist.map           +  ─┐ 
  β”œβ”€ body.href.url.ch.whitelist.map           +   β”‚
  β”œβ”€ body.href.url.de.whitelist.map           +   β”‚
  β”œβ”€ body.href.url.us.whitelist.map           +   β”‚
  β”‚                                               β”‚
  β”œβ”€ header.ip.whitelist.map                  +   β”‚
  β”‚                                               β”‚
  β”œβ”€ de                                           β”œβ”€ multimap.whitelist.conf
  β”‚   β”œβ”€ body.de.whitelist.map                    β”‚
  β”‚   β”œβ”€ sender.from.de.whitelist.map             β”‚
  β”‚   └─ subject.de.whitelist.map                 β”‚
  β”‚                                               β”‚
  └─ en                                           β”‚
      └─ ....                                    β”€β”˜

+ -> "prefilter" is set

Unfortunately, whitelisting with the prefilter option set doesn't work in some cases. I don't know why, and I can't find any help in the community. What a pity!

Tips and Tricks

Scoring

If you want to increase or decrease a symbol's score, you can do so in the UI. Click "Symbols" in the menu, then find the desired symbol and change the score.

Important

  • You can only change the scoring for a map file, or rather its symbol, and not for a single rule.
  • The scoring for a single rule can be changed in the map file.

Which rule has fired?

Unfortunately, Rspamd is unable to log the rule(s) of a map file that fired. This complicates the whole process in case of an error.

Handling false/positives

There's always a risk that an email will be mistakenly marked as spam.

If a map file is to blame, I'm happy to change or remove a rule. My rules are designed specifically for German-speaking countries. Therefore, some phrases might be too strong for English-speaking countries.

Open an issue and I'll be happy to resolve the issue.

When spam emails slip through

Great! I love fresh spam! To create one or more rules, I need the complete, unaltered email. Send it to spamcop[Γ€t]netfusion[dΓΆt]ch and add the word "SPAM" to the subject line.

About

Curated Multimaps and Rules for Rspamd

Topics

Resources

License

Stars

Watchers

Forks