<s>
Sender	B-Protocol
Policy	I-Protocol
Framework	I-Protocol
(	O
SPF	O
)	O
is	O
an	O
email	O
authentication	O
method	O
designed	O
to	O
detect	O
forging	O
sender	O
addresses	O
during	O
the	O
delivery	O
of	O
the	O
email	O
.	O
</s>
<s>
SPF	O
allows	O
the	O
receiving	O
mail	B-Protocol
server	I-Protocol
to	O
check	O
during	O
mail	O
delivery	O
that	O
a	O
mail	O
claiming	O
to	O
come	O
from	O
a	O
specific	O
domain	O
is	O
submitted	O
by	O
an	O
IP	O
address	O
authorized	O
by	O
that	O
domain	O
's	O
administrators	O
.	O
</s>
<s>
The	O
list	O
of	O
authorized	O
sending	O
hosts	O
and	O
IP	O
addresses	O
for	O
a	O
domain	O
is	O
published	O
in	O
the	O
DNS	B-Protocol
records	O
for	O
that	O
domain	O
.	O
</s>
<s>
Sender	B-Protocol
Policy	I-Protocol
Framework	I-Protocol
is	O
defined	O
in	O
RFC	O
7208	O
dated	O
April	O
2014	O
as	O
a	O
"	O
proposed	O
standard	O
"	O
.	O
</s>
<s>
Among	O
the	O
proposals	O
submitted	O
to	O
the	O
ASRG	O
were	O
"	O
Reverse	B-Protocol
MX	I-Protocol
"	O
(	O
RMX	O
)	O
by	O
Hadmut	O
Danisch	O
,	O
and	O
"	O
Designated	O
Mailer	O
Protocol	O
"	O
(	O
DMP	O
)	O
by	O
Gordon	O
Fecyk	O
.	O
</s>
<s>
Originally	O
SPF	O
stood	O
for	O
Sender	B-Protocol
Permitted	I-Protocol
From	I-Protocol
and	O
was	O
sometimes	O
also	O
called	O
SMTP+SPF	O
;	O
but	O
its	O
name	O
was	O
changed	O
to	O
Sender	B-Protocol
Policy	I-Protocol
Framework	I-Protocol
in	O
February	O
2004	O
.	O
</s>
<s>
The	O
Simple	B-Protocol
Mail	I-Protocol
Transfer	I-Protocol
Protocol	I-Protocol
permits	O
any	O
computer	O
to	O
send	O
email	O
claiming	O
to	O
be	O
from	O
any	O
source	O
address	O
.	O
</s>
<s>
SPF	O
allows	O
the	O
owner	O
of	O
an	O
Internet	O
domain	O
to	O
specify	O
which	O
computers	O
are	O
authorized	O
to	O
send	O
mail	O
with	O
envelope-from	O
addresses	O
in	O
that	O
domain	O
,	O
using	O
Domain	B-Protocol
Name	I-Protocol
System	I-Protocol
(	O
DNS	B-Protocol
)	O
records	O
.	O
</s>
<s>
Receivers	O
verifying	O
the	O
SPF	O
information	O
in	O
TXT	B-Protocol
records	I-Protocol
may	O
reject	O
messages	O
from	O
unauthorized	O
sources	O
before	O
receiving	O
the	O
body	O
of	O
the	O
message	O
.	O
</s>
<s>
Thus	O
,	O
the	O
principles	O
of	O
operation	O
are	O
similar	O
to	O
those	O
of	O
DNS-based	O
blackhole	O
lists	O
(	O
DNSBL	O
)	O
,	O
except	O
that	O
SPF	O
uses	O
the	O
authority	O
delegation	O
scheme	O
of	O
the	O
Domain	B-Protocol
Name	I-Protocol
System	I-Protocol
.	O
</s>
<s>
Current	O
practice	O
requires	O
the	O
use	O
of	O
TXT	B-Protocol
records	I-Protocol
,	O
just	O
as	O
early	O
implementations	O
did	O
.	O
</s>
<s>
For	O
a	O
while	O
a	O
new	O
record	O
type	O
(	O
SPF	O
,	O
type	O
99	O
)	O
was	O
registered	O
and	O
made	O
available	O
in	O
common	O
DNS	B-Protocol
software	O
.	O
</s>
<s>
Use	O
of	O
TXT	B-Protocol
records	I-Protocol
for	O
SPF	O
was	O
intended	O
as	O
a	O
transitional	O
mechanism	O
at	O
the	O
time	O
.	O
</s>
<s>
The	O
experimental	O
RFC	O
,	O
RFC	O
4408	O
,	O
section	O
3.1.1	O
,	O
suggested	O
"	O
an	O
SPF-compliant	O
domain	O
name	O
SHOULD	O
have	O
SPF	B-Protocol
records	I-Protocol
of	O
both	O
RR	O
types	O
"	O
.	O
</s>
<s>
The	O
proposed	O
standard	O
,	O
RFC	O
7208	O
,	O
says	O
"	O
use	O
of	O
alternative	O
DNS	B-Protocol
RR	O
types	O
was	O
supported	O
in	O
SPF	O
's	O
experimental	O
phase	O
but	O
has	O
been	O
discontinued	O
"	O
.	O
</s>
<s>
The	O
envelope-from	O
address	O
is	O
transmitted	O
at	O
the	O
beginning	O
of	O
the	O
SMTP	B-Protocol
dialog	O
.	O
</s>
<s>
If	O
the	O
server	B-Application
rejects	O
the	O
domain	O
,	O
the	O
unauthorized	O
client	B-Protocol
should	O
receive	O
a	O
rejection	O
message	O
,	O
and	O
if	O
that	O
client	B-Protocol
was	O
a	O
relaying	O
message	B-Protocol
transfer	I-Protocol
agent	I-Protocol
(	O
MTA	B-Protocol
)	O
,	O
a	O
bounce	O
message	O
to	O
the	O
original	O
envelope-from	O
address	O
may	O
be	O
generated	O
.	O
</s>
<s>
If	O
the	O
server	B-Application
accepts	O
the	O
domain	O
,	O
and	O
subsequently	O
also	O
accepts	O
the	O
recipients	O
and	O
the	O
body	O
of	O
the	O
message	O
,	O
it	O
should	O
insert	O
a	O
Return-Path	O
field	O
in	O
the	O
message	O
header	O
in	O
order	O
to	O
save	O
the	O
envelope-from	O
address	O
.	O
</s>
<s>
If	O
a	O
domain	O
publishes	O
an	O
SPF	B-Protocol
record	I-Protocol
,	O
spammers	O
and	O
phishers	O
are	O
less	O
likely	O
to	O
forge	O
emails	O
pretending	O
to	O
be	O
from	O
that	O
domain	O
,	O
because	O
the	O
forged	O
emails	O
are	O
more	O
likely	O
to	O
be	O
caught	O
in	O
spam	O
filters	O
which	O
check	O
the	O
SPF	B-Protocol
record	I-Protocol
.	O
</s>
<s>
This	O
is	O
a	O
necessary	O
and	O
obvious	O
feature	O
of	O
SPF	O
–	O
checks	O
behind	O
the	O
"	O
border	O
"	O
MTA	B-Protocol
(	O
MX	B-Protocol
)	O
of	O
the	O
receiver	O
cannot	O
work	O
directly	O
.	O
</s>
<s>
They	O
do	O
this	O
by	O
adding	O
additional	O
records	O
to	O
their	O
existing	O
DNS	B-Protocol
information	O
:	O
every	O
domain	O
name	O
or	O
host	O
that	O
has	O
an	O
A	B-Protocol
record	I-Protocol
or	O
MX	B-Protocol
record	I-Protocol
should	O
have	O
an	O
SPF	B-Protocol
record	I-Protocol
specifying	O
the	O
policy	O
if	O
it	O
is	O
used	O
either	O
in	O
an	O
email	O
address	O
or	O
as	O
HELO/EHLO	O
argument	O
.	O
</s>
<s>
Hosts	O
which	O
do	O
not	O
send	O
mail	O
should	O
have	O
an	O
SPF	B-Protocol
record	I-Protocol
published	O
which	O
indicate	O
such	O
(	O
"	O
v=	O
spf1	B-Protocol
-all	O
"	O
)	O
.	O
</s>
<s>
Checking	O
and	O
using	O
SPF	O
information	O
:	O
Receivers	O
use	O
ordinary	O
DNS	B-Protocol
queries	I-Protocol
,	O
which	O
are	O
typically	O
cached	O
to	O
enhance	O
performance	O
.	O
</s>
<s>
Thus	O
,	O
the	O
key	O
issue	O
in	O
SPF	O
is	O
the	O
specification	O
for	O
the	O
new	O
DNS	B-Protocol
information	O
that	O
domains	O
set	O
and	O
receivers	O
use	O
.	O
</s>
<s>
The	O
records	O
laid	O
out	O
below	O
are	O
in	O
typical	O
DNS	B-Protocol
syntax	O
,	O
for	O
example	O
:	O
</s>
<s>
The	O
"	O
ip4	B-Protocol
"	O
and	O
"	O
a	O
"	O
specify	O
the	O
systems	O
permitted	O
to	O
send	O
messages	O
for	O
the	O
given	O
domain	O
.	O
</s>
<s>
IP4	B-Protocol
If	O
the	O
sender	O
is	O
in	O
a	O
given	O
IPv4	B-Protocol
address	O
range	O
,	O
match	O
.	O
</s>
<s>
IP6	O
If	O
the	O
sender	O
is	O
in	O
a	O
given	O
IPv6	B-Protocol
address	O
range	O
,	O
match	O
.	O
</s>
<s>
MX	B-Protocol
If	O
the	O
domain	O
name	O
has	O
an	O
MX	B-Protocol
record	I-Protocol
resolving	O
to	O
the	O
sender	O
's	O
address	O
,	O
it	O
will	O
match	O
(	O
i.e.	O
</s>
<s>
the	O
mail	O
comes	O
from	O
one	O
of	O
the	O
domain	O
's	O
incoming	O
mail	B-Protocol
servers	I-Protocol
)	O
.	O
</s>
<s>
PTR	O
If	O
the	O
domain	O
name	O
(	O
PTR	O
record	O
)	O
for	O
the	O
client	B-Protocol
's	O
address	O
is	O
in	O
the	O
given	O
domain	O
and	O
that	O
domain	O
name	O
resolves	O
to	O
the	O
client	B-Protocol
's	O
address	O
(	O
forward-confirmed	B-Protocol
reverse	I-Protocol
DNS	I-Protocol
)	O
,	O
match	O
.	O
</s>
<s>
This	O
can	O
be	O
omitted	O
;	O
e.g.	O
,	O
+mx	O
is	O
the	O
same	O
as	O
mx	B-Protocol
.	O
</s>
<s>
exp	O
=	O
some.example.com	O
gives	O
the	O
name	O
of	O
a	O
domain	O
with	O
a	O
DNS	B-Protocol
TXT	I-Protocol
record	O
(	O
interpreted	O
using	O
SPF	O
's	O
macro	O
language	O
)	O
to	O
get	O
an	O
explanation	O
for	O
FAIL	O
results	O
—	O
typically	O
a	O
URL	O
which	O
is	O
added	O
to	O
the	O
SMTP	B-Protocol
error	O
code	O
.	O
</s>
<s>
Another	O
safeguard	O
is	O
the	O
maximum	O
of	O
ten	O
mechanisms	O
querying	O
DNS	B-Protocol
,	O
i.e.	O
</s>
<s>
any	O
mechanism	O
except	O
from	O
IP4	B-Protocol
,	O
IP6	O
,	O
and	O
ALL	O
.	O
</s>
<s>
Implementations	O
can	O
abort	O
the	O
evaluation	O
with	O
result	O
TEMPERROR	O
when	O
it	O
takes	O
too	O
long	O
or	O
a	O
DNS	B-Protocol
query	I-Protocol
times	O
out	O
or	O
they	O
can	O
continue	O
pretending	O
that	O
the	O
query	O
returned	O
no	O
data	O
—	O
which	O
is	O
called	O
a	O
"	O
void	O
lookup	O
"	O
.	O
</s>
<s>
A	O
typical	O
SPF	O
HELO	O
policy	O
v=	O
spf1	B-Protocol
a	O
mx	B-Protocol
ip4:192.0.2.0	O
-all	O
may	O
execute	O
four	O
or	O
more	O
DNS	B-Protocol
queries	I-Protocol
:	O
(	O
1	O
)	O
TXT	B-Protocol
record	I-Protocol
(	O
SPF	O
type	O
was	O
obsoleted	O
by	O
RFC	O
7208	O
)	O
,	O
(	O
2	O
)	O
A	O
or	O
AAAA	O
for	O
mechanism	O
a	O
,	O
(	O
3	O
)	O
MX	B-Protocol
record	I-Protocol
and	O
(	O
4+	O
)	O
A	O
or	O
AAAA	O
for	O
each	O
MX	B-Protocol
name	O
,	O
for	O
mechanism	O
mx	B-Protocol
.	O
</s>
<s>
In	O
addition	O
if	O
,	O
for	O
example	O
,	O
the	O
sender	O
has	O
an	O
IPv6	B-Protocol
address	O
,	O
while	O
its	O
name	O
and	O
its	O
two	O
MX	B-Protocol
names	O
have	O
only	O
IPv4	B-Protocol
addresses	O
,	O
then	O
the	O
evaluation	O
of	O
the	O
first	O
two	O
mechanisms	O
already	O
results	O
in	O
more	O
than	O
two	O
void	O
lookups	O
and	O
hence	O
PERMERROR	O
.	O
</s>
<s>
Note	O
that	O
mechanisms	O
ip4	B-Protocol
,	O
ip6	O
and	O
all	O
need	O
no	O
DNS	B-Protocol
lookup	O
.	O
</s>
<s>
To	O
enable	O
rapid	O
testing	O
and	O
deployment	O
,	O
initial	O
versions	O
of	O
SPF	O
checked	O
for	O
its	O
setting	O
in	O
the	O
DNS	B-Protocol
TXT	I-Protocol
record	O
of	O
the	O
sending	O
domain	O
-	O
even	O
though	O
this	O
record	O
was	O
traditionally	O
supposed	O
to	O
be	O
free-form	O
text	O
with	O
no	O
semantics	O
attached	O
.	O
</s>
<s>
As	O
SPF	O
increasingly	O
prevents	O
spammers	O
from	O
spoofing	O
the	O
envelope-from	O
address	O
,	O
many	O
have	O
moved	O
to	O
only	O
spoof	O
the	O
address	O
in	O
the	O
From	O
field	O
of	O
the	O
mail	O
header	O
,	O
which	O
is	O
actually	O
displayed	O
to	O
the	O
recipient	O
rather	O
than	O
only	O
processed	O
by	O
the	O
recipient	O
's	O
message	B-Protocol
transfer	I-Protocol
agent	I-Protocol
(	O
MTA	B-Protocol
)	O
.	O
</s>
<s>
SPF	O
(	O
or	O
DKIM	B-Protocol
)	O
can	O
be	O
used	O
together	O
with	O
DMARC	O
though	O
,	O
to	O
also	O
check	O
the	O
From	O
field	O
of	O
the	O
mail	O
header	O
.	O
</s>
<s>
Anti-spam	O
software	O
such	O
as	O
SpamAssassin	B-Language
version	O
3.0.0	O
and	O
ASSP	B-Language
implement	O
SPF	O
.	O
</s>
<s>
Many	O
mail	B-Protocol
transfer	I-Protocol
agents	I-Protocol
(	O
MTAs	O
)	O
support	O
SPF	O
directly	O
such	O
as	O
Courier	B-Protocol
,	O
CommuniGate	O
Pro	O
,	O
Wildcat	B-Protocol
,	O
MDaemon	O
,	O
and	O
Microsoft	B-Operating_System
Exchange	I-Operating_System
,	O
or	O
have	O
patches	O
or	O
plug-ins	O
available	O
that	O
support	O
SPF	O
,	O
including	O
Postfix	B-Application
,	O
Sendmail	B-Application
,	O
Exim	B-Protocol
,	O
qmail	B-Application
,	O
and	O
Qpsmtpd	B-Language
.	O
</s>
<s>
These	O
results	O
can	O
include	O
trivial	O
policies	O
like	O
v=	O
spf1	B-Protocol
?	O
all	O
.	O
</s>
<s>
In	O
2008	O
,	O
the	O
Messaging	O
Anti-Abuse	O
Working	O
Group	O
(	O
MAAWG	O
)	O
published	O
a	O
paper	O
about	O
email	O
authentication	O
covering	O
SPF	O
,	O
Sender	O
ID	O
,	O
and	O
DomainKeys	B-Protocol
Identified	I-Protocol
Mail	I-Protocol
(	O
DKIM	B-Protocol
)	O
.	O
</s>
<s>
In	O
their	O
"	O
Sender	O
Best	O
Communication	O
Practices	O
"	O
the	O
MAAWG	O
stated	O
:	O
"	O
At	O
the	O
very	O
least	O
,	O
senders	O
should	O
incorporate	O
SPF	B-Protocol
records	I-Protocol
for	O
their	O
mailing	O
domains	O
"	O
.	O
</s>
<s>
In	O
2015	O
,	O
the	O
Messaging	O
Anti-Abuse	O
Working	O
Group	O
(	O
MAAWG	O
)	O
revised	O
a	O
paper	O
about	O
email	O
authentication	O
covering	O
SPF	O
,	O
DomainKeys	B-Protocol
Identified	I-Protocol
Mail	I-Protocol
(	O
DKIM	B-Protocol
)	O
,	O
and	O
DMARC	O
(	O
DMARC	O
)	O
.	O
</s>
