My mail server is rejecting incoming emails

My server is not acepting emails. It was working good. but the people who send me emails are reicibing this.
Remote server returned message detected as spam → 550 Rejected because 40.92.20.101 is in a black list at zen.spamhaus.org;Error: open resolver; https://check.spamhaus.org/returnc/pub/142.93.57.224/

I went to spamhaus and it tells that is a mail server config. and I didnt touch anting.
I chech the email ports and all is open.

last email I reicibed was 16-04-2024.
Only I can send Emails.

1 Like

Show the output of this command (it will check whether the public resolver you are using (DigitalOcean) has been blocked by Spamhaus… spoiler, it is):

curl -fsSL https://7j.gg/chksph2 | bash -s --
1 Like

You are using an open resolver and Spamhaus is blocking it.

You could replace your current name servers by ones that are not being blocked by Spamhaus like Control-D (76.76.2.0 and 76.76.10.0). You could also use your own resolver or follow this doc

If you want to change the name servers used by your server, seems it is using systemd-resolved so you should edit file /etc/systemd/resolved.conf to modify the servers and restart the service after that systemctl restart systemd-resolved

1 Like

I open the file resolved.conf , what I have to do?

Replace this:

#DNS=

by this:

DNS=76.76.2.0 76.76.10.0

Save the file and restart systemd-resolved:

systemctl restart systemd-resolved

Now you could try again this command:

curl -fsSL https://7j.gg/chksph2 | bash -s --
1 Like

I did it but same response

Then you should figure out how to change the dns servers for your server.

Or you can follow the other option.

Anyway, show the output of these commands:

ls -l /etc/resolv.conf
systemctl status systemd-resolved
ls -la /etc/systemd/network/
systemd-resolve --status 

If above command doesn’t work, use this:

resolvectl status
1 Like



I can’t see the output of above command.

Show also this:

cat /etc/resolv.conf


Ok, the new dns servers are there but your system is still using the old ones, the ones that it gets from dhcp.

Could you please restart your server?

If after restart your server it shows the wrong dns ip as current name server, execute these commands:

apt install resolvconf
echo 'nameserver 76.76.2.0' >> /etc/resolvconf/resolv.conf.d/head
echo 'nameserver 76.76.10.0' >> /etc/resolvconf/resolv.conf.d/head
resolvconf -u
systemctl restart resolvconf

And try again:

curl -fsSL https://7j.gg/chksph2 | bash -s --

A bit of info would be useful, that is after restarting… after install and configure resolvconf?

I restart, Still same. I run

restart. and dont change

ls -l /etc/resolv.conf
cat /etc/resolvconf/resolv.conf.d/head
systemctl status systemd-resolved --no-pager -l
systemctl status resolvconf --no-pager -l