TYPO3 Powermail & SPF: Why your emails end up in spam – and how to fix it
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:
| Part | Meaning |
|---|---|
v=spf1 | SPF version 1 |
include:_spf.google.com | Google Workspace is allowed to send |
ip4:123.456.789.0 | Your server IP is allowed to send |
~all | Everyone else: softfail (marked as spam) |
-all | Everyone 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 failor550error 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
- Powermail defaults to using the user's email as the
From:address on receiver notifications - Your web server isn't authorised to send on behalf of the user's domain → spam or bounce
- Fix: set a fixed
noreply@yourdomain.comas sender via TypoScript - Add your sending infrastructure (server IP or SMTP relay) to your own domain's SPF record
- Verify with Mail-Tester or MXToolbox
Share
Leave a comment