SPF – Sender Policy Framework
SPF can be used to allows software to identify messages that are or are not authorized to use the domain name in the SMTP HELO and MAIL FROM Return-Path commands, based on information published in a sender policy of the domain owner. Forged return paths are common in spam and result in backscatter. SPF is defined in RFC 4408. SPF is useful as it prevents spam as the email is not coming from an authorised domain, resulting in CIDR error returns to the sending party.
Shameless pull from Wikipedia on how to Implement SPF:
Implementation
Compliance with SPF consists of three loosely related tasks:
- Publish a policy
- Domains identify the machines authorized to send e-mail on their behalf. Domains do this by adding additional records to their existing DNS information: every domain name that has an A record or MX record deserves a TXT record specifying the policy if it is used either in an email address or as HELO/EHLO argument.
- Check and use SPF information
- Receivers use ordinary DNS queries, which are typically cached to enhance performance. Receivers then interpret the SPF information as specified and act upon the result.
- Revise mail forwarding
- Plain mail forwarding is not allowed by SPF. The alternatives are
- remailing, i.e. replacing the original sender with one belonging to the local domain,
- refusing, i.e. answering
551 User not local; please try <user@example.com>, - whitelisting on the target server, so that it will not refuse a forwarded message, and
- Sender Rewriting Scheme, a more complicated mechanism that handles forwarding back-scatter back.
Thus, the key issue in SPF is the specification for the new DNS information that domains set and receivers use. The records are laid out like this (in typical DNS-syntax):
example.org. IN TXT "v=spf1 a mx -all"
“v=” defines the version of SPF used. The following words provide mechanisms to use to determine if a domain is eligible to send mail. The “a” and “mx” specify the systems permitted to send messages for the given domain. The “-all” at the end specifies that, if the previous mechanisms did not match, the message should be rejected.
Tags: Email, Security, SPF