SpamAssasin - how to block spamhaus listed IPs as cpanel user?

postcd

Well-Known Member
Oct 22, 2010
721
21
68
In some article i read that SpamAssasin can block mail based on source IP being in DNSBLs like spamhaus.org
As cPanel (v. 100.0.4) user (not admin) i do not see how to do this. I am bothered by SPAM from one company subnets currently and i see these listed also on stopforumspam.com
Can you please post instructions on how to block/delete only based on sender being on such a blocklist? Post even if only server admin can do such steps. Thank you
 

postcd

Well-Known Member
Oct 22, 2010
721
21
68
I have no root access and wondering how to do it so the RBL-only mail is deleted and NOT also mail that just fits some spam score.
 

cPanelAnthony

Administrator
Staff member
Oct 18, 2021
1,045
112
118
Houston, TX
cPanel Access Level
Root Administrator
I'm not sure how you could do this without root access, but the RBL-blocking should work that way.


These settings allow you to configure your mail server to check incoming mail against the available Real-time Blackhole Lists (RBLs). Your server blocks the incoming messages if the IP address or hostname matches an RBL entry.
As you can see, if the IP matches the RBL, the mail will be completely blocked, rather than relying on spam scores.
 

postcd

Well-Known Member
Oct 22, 2010
721
21
68
Linked documentation apply on a WHM, not a cPanel i guess. In my case this is shared hosting server so i bet admin would not be willing to delete all RBL originated mail for everyone and cpanel has no option for user to enable such removal.. How to solve it? Ideas:
- E-mail client has some addon for this task? (i was searching Thunderbird addons for rbl, dnsbl, spamhaus but no luck)
- Setup own server with a mail server where i can setup that rbl blocking (seems like overkill)
- If hosting account has a SSH or FTP access maybe bash script can be ran via crontab to periodically examine mail files parsing IP and checking it against list of IPs got from RBL (seems too complicated)
 

Handssler Lopez

Well-Known Member
Apr 30, 2019
90
33
18
Guatemala
cPanel Access Level
Root Administrator
As I see it, you only have access as administrator of cPanel not WHM.

- Have you already asked your hosting provider if you can add that RBL?

currently I only configure (for me it is enough):
bl.spamcop.net
zen.spamhaus.org

Totally apart: if you only want cPanel to filter emails with blacklisted ips and not those rated as spam, you just have to deactivate this option

cPanel> home> Spam Filters> Automatically Delete New Spam (Auto-Delete)

this setting will continue to mark emails as spam but will not delete them. At the server level, the RBLs have priority over any filter, so if a domain is whitelisted by the server but at the same time it is blacklisted by an RBL, the mail will be filtered without delivering it to the final cPanel user.

I hope this can help you