Rspamd whitelist bulk add

Is there a way to bulk add emails and domains to the rspam from whitelist?
I have about 300 I want to add, and it would be tedious to add one by one.
2nd issue, will having that many in whitelist affect rpsamd performance too much?

Just create a bash script and create a comma separated list of address, then add use these commands to set them (I didn’t test it):

config setprop SenderWhiteList <list>
signal-event nethserver-mail-filter-save

The list should have this format: mail.com,mail.org

If you do not need to see them on the UI, just create a template-custom:

mkdir -p /etc/e-smith/templates-custom/etc/rspamd/whitelist_to_domains.map
echo "domain1" >> 20custom
signal-event nethserver-mail-filter-save

Add your domains to 20custom, one per line.

Maybe @stephdl has better idea than mine :wink:

1 Like

We need a doc

I ran, the following and nothing was added to the /etc/rspamd/whitelist_from_domains.map file, or shows in the website.

config setprop SenderWhiteList test.com,test.org
signal-event nethserver-mail-filter-save

The first command gives the response;

/sbin/e-smith/db dbfile setprop key prop1 val1 [prop2 val2] [prop3 val3] …

config setprop rspamd SenderWhiteList user@domain.org,domain2.org,user2@domain.org,domain3.org
signal-event nethserver-mail-filter-save
1 Like

This works, thanks.
It’s worth noting that this deletes any existing entries, so you must add complete list again if you are adding entries.

1 Like
1 Like