[bug]: Auto-Generated SPF records in DNS causing authentication and failed mail #945
-
What happened?I copied faithfully all the DNS records into my cloudflare account from the DNS records automatically generated by Stalwart. The two subject entries are:
My first few test emails failed and the return reply was:
After some searching and using some mail tools it continually said I was failing because of having 'multiple spf records' I am now combining the above two records as follows and testing and will update thread if this fixes:
If this is indeed the case, then it would be nice to fix this so it combines both records, or, has a kind of notification that this must be done manually. How can we reproduce the problem?
Versionv0.10.x What database are you using?RocksDB What blob storage are you using?RocksDB Where is your directory located?None What operating system are you using?Linux Relevant log outputNo response Code of Conduct
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
I suggest you use an online tool such as mail-tester.com to debug your DMARC, SPF and DKIM records. Beware that some tools do not support the |
Beta Was this translation helpful? Give feedback.
You probably have stalwart running on
example.com
instead ofmail.example.com
right? In that case the generated DNS records by stalwart will be incorrect since stalwart assumes you run it under a subdomain. In this case you actually need two spf records, one for the MX on the main domain example.com and one on the subdomain mail.example.com to allow the A record. But they are under different zones. If you run stalwart on the main domain, it will falsely output two records forexample.com
. What you should do is merge them and use a single recordv=spf1 mx a ra=postmaster -all