Is virtualmin checking INCOMING mails for SPF records?

Hi all,

I am using Virtualmin GPL and I have no problems with creating SPF records for the domains hosted in the server. What about blocking incoming emails that do not match the SPF records set by their owners? Is virtualmin do it that or something must be installed on top?

My virtualmin was installed via the script on a minimal Centos 6.4



One of the tests that SpamAssassin performs is to check for SPF, and if invalid, will raise the spam score of an incoming email.


Can you please explain then why the following happened?

I used this online tool:

I put the server IP, as a sender an invalid email address (from a domain which IS hosted inside), and as the recipient a valid email address of a domain hosted inside the server.

The sender’s domain has SPF record which allows only the IP of the server and no others.
The email was sent and received at the destination mailbox. Shouldn’t this be disallowed ??

Well, it’s not disallowed, it just increases the spam score.

If you look at the X-Spam-Status header in that email, what spam tests were positive?

You can always increase the score of a spam test, in order to make it more likely that the email will be marked as spam.


Those are the only X headers.

X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,MISSING_MID
autolearn=no version=3.3.1

I don’t see anything here related to SPF… shouldn’t this be indicated?

What if I want to completely deny emails that fail SPF check?

If you look in “/etc/mail/spamassassin/init.pre”, do you see any references in there to an SPF plugin being loaded?


This is the full content of that file (excluding the initial comments):

# RelayCountry - add metadata for Bayes learning, marking the countries # a message was relayed through # # Note: This requires the IP::Country::Fast Perl module # # loadplugin Mail::SpamAssassin::Plugin::RelayCountry

URIDNSBL - look up URLs found in the message against several DNS


loadplugin Mail::SpamAssassin::Plugin::URIDNSBL

Hashcash - perform hashcash verification.

loadplugin Mail::SpamAssassin::Plugin::Hashcash

SPF - perform SPF verification.

loadplugin Mail::SpamAssassin::Plugin::SPF

This is as per default installation. I have not made any changes.
Is it correct/enough?


The below is true on CentOS 5 & 6, I am not sure about other OSes …

After much head-scratching I have figured out why SPF isn’t working, if you run spamassassin in debug mode on a test message, it tries to do the SPF check, but their is a missing perl SPF module. I grabbed them from another repository and poof SPF works perfectly.

Also on another note, is something wrong with the forum/site, everything in the forums appears in italics for me.

Yeah, you could try installing the SPF Perl module if it’s not currently installed.

The version here should work well if there isn’t one in the main CentOS repo:

I’m not sure about the forums being in italics though, they show up normally for me…