Billionmail/BillionMail · error
No SPF record found
Error message
No SPF record found
What it means
This is the direct (non-cached) failure: net.LookupTXT succeeded but none of the returned TXT records started with 'v=spf1', so the domain has no SPF record. The function then caches 'not_found' for 2 minutes, so subsequent attempts for that TTL return the '(from cache)' variants.
Source
Thrown at core/internal/controller/relay/relay_v1_list_relay_configs.go:212
}
var spf string
var finalErr error
txts, err := net.LookupTXT(domain)
if err != nil {
g.Log().Debug(ctx, "DNS TXT query failed:", domain, "Error:", err)
finalErr = err
} else {
found := false
for _, txt := range txts {
if strings.HasPrefix(txt, "v=spf1") {
spf = txt
found = true
break
}
}
if !found {
finalErr = fmt.Errorf("No SPF record found")
}
}
if spf != "" {
spfCache.Set(ctx, cacheKey, spf, 5*time.Minute)
return spf, nil
} else {
// Unable to find or query failed. Cache the "not_found" flag with a validity period of 2 minute.
spfCache.Set(ctx, cacheKey, "not_found", 2*time.Minute)
return "", finalErr
}
}
View on GitHub (pinned to fc36c76c05)
Solutions
- Publish an SPF TXT record at the domain root, e.g. 'v=spf1 include:_spf.example.com ~all'
- Verify propagation with 'dig TXT domain' or an online SPF checker
- Confirm you are checking the exact domain used as the envelope sender
- Retry after 2 minutes to bypass the negative cache
Defensive patterns
Strategy: validation
Validate before calling
// pre-check the domain before calling the API
const hasSpf = await dns.resolveTxt(domain)
.then(records => records.some(r => r.startsWith('v=spf1')))
.catch(() => false); Prevention
- Publish an SPF TXT record at the domain apex
- Verify with dig TXT after DNS changes
- Allow propagation time before testing relays
- Check the exact domain, not a subdomain
When it happens
Trigger: GetRealSPFRecord called (via ListRelayConfigs) for a domain whose TXT records exist but contain no 'v=spf1' record, or whose TXT lookup returns no relevant entries.
Common situations: Freshly created sending domain where SPF was never published; SPF configured on the wrong name; DNS provider not yet propagating the record.
Related errors
- No SPF record found (from cache)
- Failed to get server IP: %v
- sender email is required
- invalid sender email format
- invalid recipient email format: %s
AI-assisted analysis of Billionmail/BillionMail@fc36c76c05 (2026-09-05).
Data as JSON: /api/errors/85e8c749e8e12ae3.
Report an issue: GitHub.