Is your SPF record correct?

๐Ÿ”’ ๐—ฆ๐—ฒ๐—ฐ๐˜‚๐—ฟ๐—ฒ ๐—•๐—ถ๐˜๐˜€ ๐Ÿ’ก
๐—œ๐˜€ ๐˜†๐—ผ๐˜‚๐—ฟ ๐—ฆ๐—ฃ๐—™ ๐—ฟ๐—ฒ๐—ฐ๐—ผ๐—ฟ๐—ฑ ๐—ฎ๐—ฐ๐˜๐˜‚๐—ฎ๐—น๐—น๐˜† ๐—ฐ๐—ผ๐—ป๐—ณ๐—ถ๐—ด๐˜‚๐—ฟ๐—ฒ๐—ฑ ๐—ฐ๐—ผ๐—ฟ๐—ฟ๐—ฒ๐—ฐ๐˜๐—น๐˜†?

Microsoft tells you what SPF record to publish when setting up Exchange Online, but most organizations have ๐—ผ๐˜๐—ต๐—ฒ๐—ฟ ๐˜€๐˜†๐˜€๐˜๐—ฒ๐—บ๐˜€ ๐˜€๐—ฒ๐—ป๐—ฑ๐—ถ๐—ป๐—ด ๐—ฒ๐—บ๐—ฎ๐—ถ๐—น too.

Thatโ€™s where SPF records often start getting messy.

A few things worth checking:
๐Ÿ”น Keep ๐—ผ๐—ป๐—น๐˜† ๐—ผ๐—ป๐—ฒ ๐—ฆ๐—ฃ๐—™ ๐—ฟ๐—ฒ๐—ฐ๐—ผ๐—ฟ๐—ฑ for each domain or subdomain.
๐Ÿ”น Include ๐—ฎ๐—น๐—น ๐—น๐—ฒ๐—ด๐—ถ๐˜๐—ถ๐—บ๐—ฎ๐˜๐—ฒ ๐˜€๐—ฒ๐—ป๐—ฑ๐—ฒ๐—ฟ๐˜€, including third-party services.
๐Ÿ”น Stay within the ๐Ÿญ๐Ÿฌ ๐——๐—ก๐—ฆ-๐—น๐—ผ๐—ผ๐—ธ๐˜‚๐—ฝ ๐—น๐—ถ๐—บ๐—ถ๐˜, including lookups caused by nested includes.
๐Ÿ”น Define an explicit final policy. -all marks everything else as unauthorized, while ~all expresses a softer policy.
๐Ÿ”น Consider dedicated ๐˜€๐˜‚๐—ฏ๐—ฑ๐—ผ๐—บ๐—ฎ๐—ถ๐—ป๐˜€ ๐—ณ๐—ผ๐—ฟ ๐—ฏ๐˜‚๐—น๐—ธ ๐˜€๐—ฒ๐—ป๐—ฑ๐—ฒ๐—ฟ๐˜€ instead of mixing everything into your primary domain.
๐Ÿ”น Domains that should never send mail can use:
v=spf1 -all

For an Exchange Online-only domain, the record can be as simple as:
v=spf1 include:spf.protection.outlook.com -all

โš ๏ธ ๐—ฆ๐—ฃ๐—™ ๐—ฎ๐—น๐—ผ๐—ป๐—ฒ ๐—ถ๐˜€๐—ปโ€™๐˜ ๐—ฒ๐—ป๐—ผ๐˜‚๐—ด๐—ต.

SPF validates the envelope sender, not necessarily the visible From address your users see. Use ๐——๐—ž๐—œ๐—  + ๐——๐— ๐—”๐—ฅ๐—– alongside it for proper domain-level email authentication.

Author: Martin Strnad