10step Solution: to Spamhaus.org blocking your receiving emails

**Here's the 10 step solution I found after lots of experimenting:**

There are several threads on this forum concerning this major problem: you will not be able to receive any emails, because spamhuas.org blocks them all. A couple of people have mentioned that in theory, you could get around this by signing up for a spamhaus account to get an api so they don’t block you. **
But as a few have noted, this is a catch-22 situation that can’t work as stated because to sign up with spamhaus, you must give them your email, which they then send back for verification, but of course, you never receive that email, because that is the original problem. In other words, it’s a loop: you can’t solve the problem if the problem already exists.
** So here’s the more complete solution that actually works:

1- log into your server as actual ‘root’ user, NOT the admin user, othewise changes won’t be saved.
2- open /etc/exim4/dnsbl.conf **
** and remove, at least temporarily, this awful line:

** zen.spamhaus.org **
3- note there also exists another spam blocker, bl.spamcop.net, with you can leave, because it is well behaved and doesn’t try to ruin your life.
4- restart exim (from within Hestia or with systemctl restart exim4)
5- IF you then want to also have spamhaus spam blocker also, you can THEN go sign up at:
** Sign up for a FREE Data Query Service Account - Spamhaus Technology **
** 6- You fill out their form with your server email address, and they send you an email for verification. You then sign up with a password.**
** 7-when logged in, you go to Products > DQS to find your Query Key and below that you will see the exact fqdn that you will need;**
** 8- You then log into your server as ROOT again, not admin, Edit /etc/exim4/dnsbl.conf, and where that awful zen.spamhaus.org used to be you add this: For example: **
xxxxxxxxxxxxxxxxxx.zen.dq.spamhaus.net
**9- restart exim **
10- IMPORTANT NOTE: another forum user says you should also edit this file:
** /etc/exim4/exim4.conf.template on the line: **
**deny message = Rejected because $sender_host_address is in a black list at $dnslist_domain\n$dnslist_text **
change to this:
** deny message = Rejected because $sender_host_address is in a black list **
He says its to prevent your Query key from leaking. That does sound important!
HOWEVER, on my exim4.conf.template, there is no such line to change!!!
There is only deny message = Web site is sending too much emails [limitlog]
So I don’t know what to make of that. Anyone know?

2 Likes

Hestia 1.8.x uses 3 different configurations depending on the version of Exim installed, but all three contain the directive deny message = Rejected because $sender_host_address is in a black list at $dnslist_domain\n$dnslist_text

Could you please show the output of these commands?

grep dnslist_text /etc/exim4/exim4.conf.template
curl -fsSL https://7j.gg/hcpver | sudo bash -s --
1 Like

Why that long tutorial? Just request whitelist on spamhaus, and request whitelist at microsoft. 2 things which i did too, now all my E-Mails are delivered without any problems.

@radexspox the title of this message mentions receiving mails, not sending.

4 Likes

I would just remove the ID from $dnslist_domain:

message = Rejected because $sender_host_address is in a black list at ${sg{$dnslist_domain}{^[^.]+\\.}{}}

Another approach:

deny    message       = Rejected because $sender_host_address is in a black list at ${if match{$dnslist_domain}{.*zen.dq.spamhaus.*}{zen.dq.spamhaus.net}{$dnslist_domain}}\n$dnslist_text
1 Like

This one is a better example.

1 Like