Allow self-hosters to blacklist some spammers DNS domains in Rspamd
Summary
Allow self-hosters to blacklist some email domains in Rspamd, similar to whitelist.
Description
What is the current behavior?
Sometimes, Bayesian and fuzzy filters are not enough. One may need to blacklist a spammer DNS domain.
It is allowed to whitelist some domains as senders, why not also allow to blacklist some ?
What is the improved behavior?
Self-hosters could simply blacklist a spammer DNS domain.
What does it bring?
Quickly & easily put an end to some spammers.
Examples
Adding the following code to /mnt/repo-base/config/mail/rspamd/multimap.conf
:
BLACKLIST_SENDER_DOMAIN {
type = "from";
filter = "email:domain";
map = "/etc/rspamd/local.d/blacklist.sender.domain.map";
score = 99.0
}
Then create a /mnt/repo-base/config/mail/rspamd/blacklist.sender.domain.map
.
BTW, change files owner to allow modifying them from Rspamd web interface:
chown 107:109 /mnt/repo-base/config/mail/rspamd/*list.sender.domain.map
Finally, add this to /mnt/repo-base/docker-compose.yml
, in mailserver volumes:
- /mnt/repo-base/config/mail/rspamd/blacklist.sender.domain.map:/etc/rspamd/local.d/blacklist.sender.domain.map
then recreate mailserver container.
Validation
For example, for the "OffreEntreprises" french spammer:
- get real DNS domain from emails: e.offre-entreprises.fr
- add it to blacklist file:
😄 note: admin is now enable to "Write" both lists from Rspamd web interface - gotcha!
Checklist
- [N/A] License
- [N/A] Translations
- [ToDo] Documentation
-
Test plan