TYPO3 Powermail & SPF: Why your emails end up in spam – and how to fix it
Typo3

TYPO3 Powermail & SPF: Why your emails end up in spam – and how to fix it

Yannick Aister 3 min read

What is SPF anyway?

SPF stands for Sender Policy Framework – a DNS record that defines which mail servers are authorised to send emails on behalf of your domain.

When a mail server receives an email, it checks: Is this server actually allowed to send mail from this sender domain? If the sending server isn't listed in the SPF record, the email ends up in spam – or gets rejected outright.

The problem with Powermail

Powermail has two distinct mail types:

  • Sender mail – goes to the person who filled out the form (e.g. a confirmation)
  • Receiver notification – goes to your internal team

The issue almost always lies with the receiver notification. Why?

By default, Powermail sets the sender address (From:) to the email address the user entered in the form – for example customer@gmail.com.

Your web server then tries to send an email from customer@gmail.com. The receiving mail server checks the SPF record for gmail.com – and of course your web server isn't listed there.

Result: Spam folder or bounce.

The fix: use a fixed sender like noreply@yourdomain.com

The cleanest solution is to use your own domain address as the From: address – for example noreply@yourdomain.com. You control that domain, so you can add your web server to its SPF record.

Configure the receiver mail in Powermail

In the Powermail settings (TypoScript) you can explicitly set the sender of the receiver notification:

 

plugin.tx_powermail.settings.setup {
    receiver {
        overwrite {
            senderEmail = noreply@yourdomain.com
            senderName = Website Contact Form
        }
    }
}

 

This means the internal notification will always be sent from noreply@yourdomain.com, regardless of what the user entered in the form.

Tip: You can still set the reply-to address to the user's email so you can reply directly:

 

replyToEmail = {field_email}
replyToName = {field_name}

Configuring the SPF record correctly

For your mail server to be treated as an authorised sender, it needs to be listed in your domain's SPF record.

A typical SPF record in your DNS zone looks like this:

 

v=spf1 include:_spf.google.com ip4:123.456.789.0 ~all

 

Here's what each part means:

PartMeaning
v=spf1SPF version 1
include:_spf.google.comGoogle Workspace is allowed to send
ip4:123.456.789.0Your server IP is allowed to send
~allEveryone else: softfail (marked as spam)
-allEveryone else: hardfail (rejected)

Replace 123.456.789.0 with your actual web server IP. You'll find it in your hosting control panel.

Debugging: where's my problem?

If you're not sure whether SPF is actually the culprit, these tools will help:

  • MXToolbox SPF Checker – validates your SPF record
  • Mail-Tester – send a mail to their test address and get a detailed deliverability score
  • Your server's mail log – look for SPF fail or 550 error codes

Another common suspect: DKIM. If SPF looks fine and emails still end up in spam, check whether DKIM is configured for your domain. That's a topic for another post though.

TL;DR

  1. Powermail defaults to using the user's email as the From: address on receiver notifications
  2. Your web server isn't authorised to send on behalf of the user's domain → spam or bounce
  3. Fix: set a fixed noreply@yourdomain.com as sender via TypoScript
  4. Add your sending infrastructure (server IP or SMTP relay) to your own domain's SPF record
  5. Verify with Mail-Tester or MXToolbox

Leave a comment