Janos Pasztor

Fixing RDNS_NONE with Spamassassin

After filtering spam with Exim, I wanted to add Spamassassin to do content based filtering. While testing the spam filtering, I ran into a bit of an issue: I encountered a spam score factor in every single e-mail: RDNS_NONE with the score of 1.3.

Doing a quick Google turns up some less-than-useful documentation pages and a lot of people with the same problem, yet no solution. So let’s go hunting…


In theory Spamassassin checks all Received headers and looks for IP addresses and reverse DNS checks added by the mail server. So if you have RDNS_NONE in all your mail, it means that your mail server doesn’t check the reverse DNS properly. Except my mail server did.

Looking at the code

Since obviously this whole issue is a bit underdocumented, I went to look at the SA code. (For the record: I hate Perl.) After grep‘ing around in the code, I became suspicious of /usr/share/perl5/Mail/Spamassassin/Message/Metadata/Received.pm. This file basically contains a big honk of regular expressions for all kinds of mail servers.

So, if you have a custom Received header, it won’t work.

Fixing the issue

If your mail server is set up properly, you shouldn’t accept mail from servers without proper reverse DNS. You may also want to check my previous blogpost on filtering spam with Exim.

In other words you may not even need this rule. So to disable it, enter the following line in /etc/spamassassin/local.cf:

score RDNS_NONE 0

Only do this if you reject messages form servers without a reverse DNS on your mailserver! This will effectively disable this rule from running.

Do you have a better solution? Do you have something to add? Leave a comment below!

Janos Pasztor

I'm a DevOps engineer with a strong background in both backend development and operations, with a history of hosting and delivering content.

I run an active DevOps and development community on Discord, and if you like what I do and would like me to do more, you can also support me on Patreon.

Support me on


Join the community



Facebook Facebook Twitter Twitter GitHub GitHub
YouTube YouTube RSS Atom Feed
Do you want more? Click the buttons below!