Why I treat ~all and -all as a separate decision from adding an include

When a new mail vendor asks for an SPF include, the tempting edit is to paste their mechanism into the existing record and republish it in the same sitting. I do that part carefully, and I treat the final all mechanism as a different decision. ~all is a softfail. -all is a fail. They are not a formatting choice, and they are not a way to “make room” for a new include.

The record I am editing lives on the From domain, as a single TXT value that starts with v=spf1. I look it up first:

dig +short TXT example.com

If there are already two v=spf1 strings, I stop. Adding a third will not clarify anything; two records are a usual path to a permerror. If there is one record, I copy it, add the new include in a text file, and only then replace the published value. I also count the mechanisms that cause extra lookups (include, a, mx, ptr, exists, redirect). There is a cap on those lookups, and 10 is the number most references still use. A new include that itself contains includes can be the one that goes over, even when the vendor’s documentation is short.

After the change, I query again and read the whole string, including the ending I did not mean to touch. I have seen a panel append a new include and also leave the old record in place, or rewrite the end of the record while I was only trying to add a host. If the live ending is not the one I intended, I fix that before I send real mail.

I still confirm DKIM and DMARC in the same sitting, because SPF is only one path. DKIM needs a selector from a real message (s= in DKIM-Signature). DMARC, at _dmarc.example.com, will not pass on SPF alone if that SPF result is not aligned with From. Tightening all from ~all to -all does not repair an alignment problem, and it can make a leftover unused sending path more painful once receivers treat the failure as a fail rather than a softfail.

I use the shell for this. When I want a reread of the published DNS, plus SSL, redirects, and robots.txt, I also have a free browser page I made:

I keep a short log of the edit: the From domain, the include I added, the lookup count I estimated, and the all mechanism before and after. If mail starts failing later, I can see whether the ending changed when I did not mean it to.

I also send one test message after the DNS has had time to settle, and I read Authentication-Results. An SPF pass that is not aligned still will not satisfy DMARC. That is another reason not to treat the include and the all mechanism as a single bundled change. The include is about authorizing a source. The ending is about what you ask receivers to do with mail that does not match.

If the new include is a temporary test, I write down that it is temporary. Temporary entries have a way of staying in the record for months, where they quietly spend lookup budget. I would rather remove a test include I no longer need than flatten the whole record in a hurry and then miss a vendor’s later host change.

https://tools.alinkgram.com

It is my project (ALinkgram), and there is no fee to use it. It can only show what is published at request time. It cannot tell you whether a new include is enough, and it cannot tell you whether changing all is appropriate for your receivers. If you have a panel that rewrote the ending of an SPF record without asking, I would like to know which host it was.

readers loved this