[Rspamd-Users] whitelisting before blacklisting

Albrecht Backhaus albrecht.backhaus at gmail.com
Sun Jan 12 17:24:20 UTC 2020


Hi there

I do have the following setup with white-listing and black-listing of 
domains, addresses and tld:

/etc/rspamd/local.d/multimap.conf
sender_from_whitelisted_domain {
             type ="header";
             header = "from";
             filter = "email:domain";
             map = 
"file:///etc/rspamd/local.d/maps.d/whitelist_from_domain.map";
             regexp = true;
             symbol = "SENDER_FROM_WHITELISTED_DOMAIN";
             action = "accept"; # Prefilter mode
}
sender_from_whitelisted_tld {
             type = "header";
             header  = "from";
             filter = "email:domain:tld";
             map = 
"file:///etc/rspamd/local.d/maps.d/whitelist_from_tld.map";
             regexp = true;
             symbol = "SENDER_FROM_WHITELISTED_TLD";
             action = "accept"; # Prefilter mode
}
sender_from_whitelisted_addr {
             type = "header";
             header = "from";
             filter = "email:addr";
             map = 
"file:///etc/rspamd/local.d/maps.d/whitelist_from_addr.map";
             regexp = true;
             symbol = "SENDER_FROM_WHITELISTED_ADDR";
             action = "accept"; # Prefilter mode
}
sender_from_blacklisted_domain {
             type = "header";
             header  = "from";
             filter = "email:domain";
             map = 
"file:///etc/rspamd/local.d/maps.d/blacklist_from_domain.map";
             regexp = true;
             symbol = "SENDER_FROM_BLACKLISTED_DOMAIN";
             action = "reject"; # Prefilter mode
}
sender_from_blacklisted_tld {
             type = "header";
             header = "from";
             filter = "email:domain:tld";
             map = 
"file:///etc/rspamd/local.d/maps.d/blacklist_from_tld.map";
             regexp = true;
             symbol = "SENDER_FROM_BLACKLISTED_TLD";
             action = "reject"; # Prefilter mode
}
sender_from_blacklisted_addr {
             type = "header";
             header  = "from";
             filter = "email:addr";
             map = 
"file:///etc/rspamd/local.d/maps.d/blacklist_from_addr.map";
             regexp = true;
             symbol = "SENDER_FROM_BLACKLISTED_ADDR";
             action = "reject"; # Prefilter mode
}


I do have black-listed e.g. all domains containing minimum one digit in 
the domain name e.g. "domainname1.tld"

/etc/rspamd/local.d/maps.d/blacklist_from_domain.map
#domains containing numbers
[A-Za-z-]{0,62}\d[\dA-Za-z-]{0,62}\.[A-Za-z]{1,63}$

When I now white-list "123domain.tld" :

/etc/rspamd/local.d/maps.d/whitelist_from_domain.map
# whitelisted domains
123domain.tld

it does not work. The mails are matched first by the blacklist filter 
and will then be rejected.

Is there any way to get the white-listing handled first ?

Any help/idea is highly appreciated.

Regards, Albrecht


More information about the Users mailing list