Phishing, Spam and CEO Fraud in Associations: How to Protect Yourself with SPF, DKIM and DMARC on Your Virtualmin Server

Learn how to secure your association's email communication with SPF, DKIM and DMARC on your Virtualmin server and protect yourself from phishing, spam and CEO fraud.

Why email security is becoming increasingly important for associations

Associations are often at the center of their members' trust. But criminals exploit exactly this trust: phishing attacks, spam and CEO fraud (also known as fake president scam) are increasing rapidly. In the latter, fraudsters pose as board members or managing directors and request urgent transfers or sensitive data via email. Particularly perfidious: the sender address looks deceptively real – often the association's domain is simply forged.

It is all the more important to arm your own email infrastructure against such attacks. The three technologies SPF, DKIM and DMARC offer effective protection. In this article, you will learn how to set them up on a Virtualmin server.

What are SPF, DKIM and DMARC?

Before we get to the setup, let's briefly clarify what lies behind the abbreviations:

  • SPF (Sender Policy Framework): A DNS record that defines which servers are allowed to send emails for your domain. Recipient servers can thus check whether the email comes from an authorized server.
  • DKIM (DomainKeys Identified Mail): A cryptographic signature attached to every email. The recipient can use it to verify that the message actually originates from your domain and was not manipulated in transit.
  • DMARC (Domain-based Message Authentication, Reporting and Conformance): A policy that defines how recipients should handle emails that fail SPF or DKIM checks. DMARC also enables reporting of authentication failures.

Together they form a multi-layered shield against email forgery.

Preparation: What you need on your Virtualmin server

To set up SPF, DKIM and DMARC, you need:

  • A Virtualmin server (e.g., on a virtual server or web hosting package).
  • Access to the DNS management of your domain (either via Virtualmin or your domain registrar).
  • Basic knowledge of server administration.

If you don't have a domain yet, you can register one with us.

Step 1: Configure SPF record

SPF is stored as a TXT record in DNS. In Virtualmin, you can manage DNS records directly if the server acts as a nameserver. Otherwise, you must set the records with your domain provider.

A typical SPF record for a Virtualmin server with Postfix looks like this:

v=spf1 mx a ip4:YOUR.SERVER.IP ~all

Explanation:

  • v=spf1: Identifies the record as SPF.
  • mx: Allows all servers listed in the MX record of your domain.
  • a: Allows the server pointed to by the A record.
  • ip4:YOUR.SERVER.IP: Explicitly allows your server's IP address.
  • ~all: All other servers are marked as "softfail" (emails are likely to be rejected, but not necessarily).

Tip: If you use an external mail service like Google Workspace, you must also include its servers in the SPF record (e.g., include:_spf.google.com).

Step 2: Enable DKIM in Virtualmin

Virtualmin comes with integrated DKIM support. Here's how to enable it:

  1. Log in to Virtualmin and select the appropriate virtual server.
  2. Go to Email Settings > DKIM Signature.
  3. Enable the option "Enable DKIM signing".
  4. Virtualmin automatically generates a private key and publishes the public key as a DNS TXT record (under default._domainkey.yourdomain.com).
  5. Make sure this DNS record is set correctly (either in Virtualmin or with your DNS provider).

Alternatively, you can set up DKIM manually. You can find the instructions in the knowledge base.

Important: The private key must be kept secure. Virtualmin stores it encrypted.

Step 3: Define DMARC policy

DMARC is also stored as a TXT record in DNS, specifically under _dmarc.yourdomain.com. A typical record looks like this:

v=DMARC1; p=quarantine; rua=mailto:dmarc@yourdomain.com; ruf=mailto:dmarc@yourdomain.com; fo=1

Explanation:

  • v=DMARC1: Identifies the record as DMARC.
  • p=quarantine: Emails that fail SPF and DKIM are moved to the quarantine folder (recommended for the beginning). Later you can increase to p=reject to completely reject such emails.
  • rua: Address for aggregate reports (recommended).
  • ruf: Address for forensic reports (optional).
  • fo=1: Specifies when forensic reports should be sent.

Start with p=none to monitor traffic and gradually increase strictness.

Step 4: Monitoring and adjustment

After setup, it is important to analyze the DMARC reports. These show you which servers are sending emails for your domain and whether there are authentication failures. This allows you to identify and fix misconfigurations.

Virtualmin does not offer integrated DMARC report evaluation, but there are open-source tools like OpenDMARC or DMARC Report Analyzer that you can install on your server.

Regularly check the settings and adjust them to your needs.

Conclusion: More security for your association

Setting up SPF, DKIM and DMARC on your Virtualmin server is an important step to protect your association from phishing, spam and CEO fraud. It requires some technical know-how, but the effort is worth it. Your members and business partners can rely on emails from your association's domain being authentic.

If you need support with the setup, check out our knowledge base or contact us. We are happy to help.