Why an SPF Record All Can Disable Redirect
In this article
An SPF record with all (like v=spf1 ... -all) can disable email redirects because it tells receiving mail servers to reject any message sent from your domain that isn’t listed in the record, and redirect services typically send mail from a different IP address or domain. When you set up a redirect (also called an email forward), the original message is re‑sent by the forwarding server, which is not in your SPF record—so the receiving server sees a failed SPF check and may bounce or mark the email as spam. The key is understanding how SPF interacts with forwarding and how to configure it so legitimate redirects still pass.
Background: What SPF Actually Does
Sender Policy Framework (SPF) is an email authentication method defined in RFC 7208. It lets a domain owner publish a list of IP addresses or hostnames that are authorized to send email on behalf of that domain. When a receiving server gets a message, it checks the envelope sender (the return‑path address) against the published SPF record for that domain. If the sending IP isn’t in the list, the server applies the rule specified at the end of the record—typically -all (hard fail), ~all (soft fail), or +all (pass all).
The all mechanism is a catch‑all that matches every IP. It’s always placed at the end of the record to define the default result for any IP not previously matched. For example, v=spf1 ip4:192.0.2.10 -all means “only allow mail from 192.0.2.10; reject everything else.”
How Redirects Break SPF
When you set up an email redirect (forwarding) from old@example.com to new@otherdomain.com, the forwarding server receives the original message and then re‑sends it to the final destination. The critical detail is that the forwarder usually uses its own IP address as the sending IP, but it keeps the original envelope sender (the return‑path) unchanged—or it may alter it in ways that still reference your original domain.
So the receiving server at otherdomain.com sees a message that claims to be from example.com but comes from the forwarder’s IP. It looks up example.com’s SPF record. If that record ends with -all, the check fails because the forwarder’s IP isn’t listed. The receiving server may then reject the email, bounce it, or send it to spam—effectively “disabling” the redirect.
Even if the forwarder uses a subdomain (like forward.example.com), the envelope sender often remains example.com, so the SPF check still applies to the original domain.
Why all Is the Culprit
The all mechanism is what makes the SPF check decisive. Without it, a record like v=spf1 ip4:192.0.2.10 would be neutral—receiving servers would treat unmatched IPs as “no result” and usually accept the email. The -all (hard fail) is the strictest, telling the receiver to reject the message outright. ~all (soft fail) says “probably not authorized, but accept it anyway” (often marked as spam). +all would allow everything, which defeats the purpose of SPF.
So when a redirect happens, the forwarder’s IP is not in your SPF record, and the all rule triggers. The more restrictive your all rule, the more likely the redirect is blocked.
How to Fix Redirects Without Disabling SPF
You have several options to keep both SPF and redirects working. The best choice depends on your control over the forwarding server.
- Add the forwarder’s IP to your SPF record – If you control the forwarding server, simply add its IP or hostname to your SPF record. For example:
v=spf1 ip4:192.0.2.10 include:forwarder.example.com -all. This explicitly authorizes the forwarder. - Use SRS (Sender Rewriting Scheme) – The forwarding server rewrites the envelope sender to a domain it controls (e.g.,
srs0=abc@forwarder.com). This breaks the SPF dependency on your domain. Many modern forwarding services use SRS automatically. - Use a subdomain for forwarding – If you forward from
forward.example.comto another domain, the envelope sender becomesforward.example.com, and you can publish a separate SPF record for that subdomain. This isolates the forwarding from your main domain’s SPF. - Use
~allinstead of-all– This is a compromise: it allows the redirect to be delivered (though possibly marked as spam) while still signaling that unlisted senders are suspicious. Not ideal for security, but it prevents hard bounces. - Use an email forwarding service that handles SPF – Services like Anar Send, ImprovMX, or Cloudflare Email Routing automatically rewrite the envelope sender or use SRS so that SPF checks pass. They also handle DKIM and DMARC alignment.
Common Problems and Misconceptions
Misconception: “SPF only checks the header from address.” Actually, SPF checks the envelope sender (the return‑path), not the visible “From” header. This is why a redirect can fail even if the visible From address is unchanged.
Problem: Multiple forwarding hops. Each hop can change the envelope sender, and if any hop fails SPF, the message may be rejected. SRS handles this by rewriting the sender at each hop.
Problem: Mixing SPF with DMARC. DMARC builds on SPF and DKIM. Even if SPF fails, DMARC can pass if DKIM passes and the domain aligns. But many receiving servers still check SPF independently, so a hard fail can cause rejection before DMARC is evaluated.
Misconception: “Adding all is required for SPF to work.” SPF works without all, but the result is neutral for unmatched IPs. The all mechanism is what makes SPF strict or lenient. You can have a valid SPF record without it, but it’s not recommended because it provides no explicit policy.
Best Practices for SPF and Redirects
To avoid breaking redirects while maintaining security:
- Always include
-allor~allat the end of your SPF record, but ensure all legitimate senders (including forwarders) are listed before it. - If you use a third‑party forwarding service, verify that it supports SRS or sender rewriting. Most reputable services do.
- Monitor your email deliverability. If you notice bounces after changing SPF, check the exact error message—it often says “SPF fail” and includes the IP that caused it.
- Use DMARC with a policy of
noneinitially to see how your email is handled, then tighten it gradually. - Keep your SPF record under the 10‑lookup limit (RFC 7208). Each
includeoramechanism counts as a lookup; exceeding it causes a permanent error.
Alternatives to SPF for Redirects
SPF is not the only authentication method. DKIM (DomainKeys Identified Mail) signs the message with a private key, and the signature survives forwarding as long as the forwarder doesn’t modify the message. DMARC uses both SPF and DKIM to determine alignment. For redirects, DKIM is often more reliable because it doesn’t depend on the sending IP. However, some forwarders strip or alter DKIM signatures, so it’s not a guaranteed fix.
Another alternative is to avoid traditional forwarding altogether: use a mailing list or a dedicated subdomain that you control, or set up mailbox rules that forward within the same mail server (which doesn’t change the envelope sender).
Frequently Asked Questions
Why does my redirect fail only when I use -all?
Because -all tells receiving servers to reject any message that isn’t from an IP in your SPF record. The forwarder’s IP isn’t in the record, so the check fails. With ~all, the message is accepted but may be marked as spam.
Can I add the forwarder’s IP to my SPF record?
Yes, if you know the IP address or hostname of the forwarding server. Add it as an ip4: or include: mechanism before the all rule. This authorizes that server to send mail on behalf of your domain.
What is SRS and how does it fix redirects?
SRS (Sender Rewriting Scheme) rewrites the envelope sender to a domain controlled by the forwarding service. For example, srs0=abc@forwarder.com. The receiving server then checks SPF for forwarder.com, which passes because the forwarder is authorized for its own domain. This preserves SPF integrity without requiring changes to your record.
Does DMARC help with redirects?
DMARC can help if DKIM passes and aligns with your domain, even if SPF fails. However, many receiving servers still reject on SPF hard fail before DMARC is considered. DMARC is not a substitute for fixing the SPF issue.
Should I use -all or ~all?
Use -all if you are confident that all your legitimate senders are listed and you want strict rejection of spoofed mail. Use ~all if you want to be lenient and avoid bounces, especially when you have redirects that you can’t fully control. Many experts recommend starting with ~all and monitoring, then moving to -all once you’re sure.
Can I have multiple SPF records?
No. RFC 7208 states that a domain must have only one SPF record. If you have multiple, receiving servers may return a “permerror” and treat the message as neutral or fail. Combine all mechanisms into a single record.