Smtp filter with Rspamd


(Евгений Копьев) #1

**NethServer Version:Last
Hey. I have the smtp filter with Rspamd, how do I add addresses to black list and white list. If the addresses of about 2000 ?

(Rob Bosch) #2

I didn’t try this, but this might be an option:

(Евгений Копьев) #3

I mean Rspamd in the implementation of the nethserver. In rspamd itself, this is done through the web interface. But in the plug-in to the nethserver. The file is read-only and can only be added to 1 address through the nethserver interface. Long addition will be))))

(Stéphane de Labrusse) #4

@davidep sometime ago did a script to learn email to spam from a imap folder…need to find it again…some clue ?

Oups a misunderstood your issue…you want to add email adresses manually from a file…let me check…we could create a second map for this purpose.

The first blacklist map is a template created from db properties, we need another map for this

(Евгений Копьев) #5

My Communigate mail server is located on a separate Server, it would be nice to hook up the spam folder with NS to it. But you can still manually add. But I already have a large list of addresses and would like to add it immediately.

(Stéphane de Labrusse) #6

Ok not tested, we could do something for you

in the file /etc/rspamd/local.d/multimap.conf you have declaration for the map we use for instance

# whitelist the senders
    type = "from";
    map = [
    prefilter = true;
    filter = "email:addr";
    action = "accept";
    description = "Accepted list of FROM email address";
    symbol = "FROM_WHITELIST";

the idea is to add the path to a new map

    map = [

the path is /etc/rspamd, be sure of the permission on the new file and add inside one address per line

Restart rspamd after : systemctl restart rspamd

Your work will be overwritten by the next time you save a setting in the filter panel, we need to find a way to add it probably by a db property.

@davidep what do you think, the idea is to create blacklist/whitelist from a file for those who have a long list, here around 2000

@kelevra can you test it by adding the maps needed, one by whithelist and blacklist

Card created in issue tracker

(Davide Principi) #7

I don’t know… A long list seems hard to maintain

(Stéphane de Labrusse) #8

We have two ways but first I would like to do it by a hidden prop, once enabled you could either add manually with vim, or by the web UI

(Stéphane de Labrusse) #9

Ok just tested now…do not waste your time if you want to blacklist a gmail address…gmail wants to be different =>


maybe we should do a documentation on this

(Stéphane de Labrusse) #10

I did an issue

(Giacomo Sanchietti) #11

IMO, this is a very special case and it doesn’t worth an implementation inside the package.

We can just document here, or somewhere else, how to do it using a template-custom.

(Davide Principi) #12

Why not to follow @giacomo’s approach?

@kelevra’s request seems a typical template-custom use case which does not require additional code!

Maybe I’m wrong but the two templates to customize are:

  • /etc/e-smith/templates/etc/rspamd/
  • /etc/e-smith/templates/etc/rspamd/

(Stéphane de Labrusse) #13

Yep it is just one way, but then the system administrator is on his own to follow the modifications we can push.

mkdir /etc/e-smith/templates-custom/etc/rspamd/local.d/multimap.conf
cp /etc/e-smith/templates/etc/rspamd/local.d/multimap.conf/10base /etc/e-smith/templates-custom/etc/rspamd/local.d/multimap.conf
vim /etc/e-smith/templates-custom/etc/rspamd/local.d/multimap.conf/10base

and add the map you need for example

map = [

(Giacomo Sanchietti) #14

And that’s fine: not everything should be added to a package. :wink:
More code, more bugs, more things to maintain. :scream_cat:

IMO, configuration corner cases should be always demanded to custom-templates.