Sender Authentication Whitepaper
Sender Authentication Whitepaper
����
��� ����������
�������������
DomainKeys
���������
SPF
���������������������
����������
�����������������
������������������������������������������������
Contents
Introduction 3 Deployment: For Email Receivers 6
Audience 3 Two Sides of the Coin 6
How to Read this White Paper 3 Recording Trusted Senders Who Passed Authentication 6
A Vision for Spam-Free Email 4 Whitelisting Incoming Forwarders 6
The Problem of Abuse 4 What To Do About Forgeries 6
The Underlying Concept 4 Deployment: For ISPs and Enterprises 7
Drivers; or, Who’s Buying It 4 Complementary considerations for ISPs 7
Vision Walkthrough 5 Deployment: For MTA vendors 8
About Sender Authentication 8 Which specification? 8
An Example 8 Conformance testing 8
History 8 Perform SRS and prepend headers when forwarding 8
How IP-based Authentication Works 9 Add ESMTP support for Submitter 8
The SPF record 9 Record authentication and policy results in the headers 8
How SPF Classic Works 9 Join the developers mailing list 8
How Sender ID works 9 Deployment: For MUA vendors 9
How Cryptographic Techniques Work 0 Displaying Authentication-Results 9
Using Multiple Approaches Automatic switching to port 587 9
Reputation Systems Deployment: For ESPs 20
Deployment: For Email Senders 2 Don’t look like a phisher! 20
First, prepare. 2 Delegation 20
Audit Your Outbound Mailstreams 2 Publish Appropriately 20
Construct the record 2 Deployment: For Spammers 2
Think briefly about PRA and Mail-From contexts. 3 Two Types of Spammers 2
Test the record, part 3 Publish SPF and sign with DomainKeys. 2
Put the record in DNS 3 Stop forging random domains. 2
Test the record, part 2 4 Buy your own domains. 2
Keep Track of Violations 4 Reuse an expired domain. 22
Loose Ends: Publishing Records For Hostnames 4 Try to buy accreditation. 22
Loose Ends: Deferral Relays 5 Try to fake out reputation services. 22
To Fail or not to Fail? 5 Zombies should spam only their friends and family. 22
Expect to use DomainKeys or other crypto 5 Spread FUD about the edge cases. 22
Deployment Roadmap 23
ISP Best Practices and Code of Conduct 24
http://spf.pobox.com/whitepaper.pdf
Introduction
2004 saw a great deal of hue and cry about spam. Now the
dust is beginning to settle. A number of complementary ������������
technologies are still standing. They will be rolled out in �����������������������
2005. This white paper explains why they’re important, how
they work, and how you can put them to use. ����������������������
The email infrastructure as originally designed lacks a ��������������������
critical element: sender authentication. Sender authentica- ��������������
tion gives computers the ability to tell whether a message is
forged or authentic. Without that ability, receiver systems ������������������������������
cannot easily detect and block forgeries at SMTP time. Add- ���������������
ing that ability sets the stage for complementary technolo-
gies — reputation and accreditation systems. Together, these ���������������������������������
technologies make it possible to build a spam-free layer on ����������
top of the existing email system.
Sender authentication protocols will be widely deployed ����������������������������������
in 2005. This document explains why they are important, �������������
how they work, and how you can deploy them. It pays par-
ticular attention to SPF, Sender ID, and DomainKeys.
Audience
���������������������������
�����������������������������������������������������������������������������������������
The Problem of Abuse
������������������������������������������������������������������������
����������������������������������������������������������������������������
Anyone can send email to anyone else, within seconds, at
��������������������������������������������������������������������������
�����������������������������������������������������������������������
zero apparent cost. That is the greatest strength of the Inter-
��������������������������������������������������������������������������
net mail system. It is also its greatest weakness. Because the
������������������������������������������������������������������
system is biased in favour of delivery, it is prone to abuse in
��������������������������������������������������������������������������������������������������������������������������������
the form of spam, viruses, and phishing scams. The very fea-
tures that made email successful now threaten its viability.
���������������������������������������������������
����������������������������������������������������
To combat abuse we must add accountability. On a so-
�����������������������������������������������������������������������������������������������������
cial level, legislative approaches such as can-spam attempt to
punish spammers for their trespasses. On a technical level,
�������������������������������������������������������������������������������������
sender authentication protocols give computers new ways to
automatically distinguish forgeries from authentic messages.
��������������������������������������������������������������������
���������������������������������
������������������������������
������������������
The Underlying Concept
������������������������
���������������������������������������������������
If you step back and squint, every plan for solving spam looks
roughly the same.
Senders are asked to do X. Receivers are asked to check
for X. If X is missing, receivers are to assume the message
is spam. X is meant to be hard for spammers and easy for
good guys.
Approaches mostly differ about what exactly goes into X.
The challenge is to make X as lightweight as possible while
������������������
����������������������������������������������������
�����������������������������������������������������������������������
������������������������������������������������������������������������
���������������������������������
�������������������������������������
���������������������������������������������������������������������������
������������������������������������������������������������������
�����������������������������������������������������������
��������������������������������������������������������������������
���������������������������������������������������������������������
�������������������������������������������������������������
remaining robust and secure.
Under the Aspen Framework, X is two things together:
authentication and reputation. (The third thing, accredita-
tion, is used as a buffer for when the reputation part fails.)
Authentication, in turn, enjoys a surfeit of competing and
complementary technologies.
The vision described here is actually an amalgam of three
related visions: the gospel according to Sender ID, the gospel
according to SPF, and the gospel according to DomainKeys.
The vision for a spam-free email system contains many parts. … All experience hath shewn, that mankind are more
This walkthrough describes the life cycle of an email message disposed to suffer, while evils are sufferable, than to
under a strong version of the vision. In practice, it may be right themselves by abolishing the forms to which they
possible for you to alter or selectively weaken certain parts of are accustomed. […] it is their right, it is their duty,
the model to suit local conditions. to throw off such Government, and to provide new
Guards for their future security.
An MUA submits a message to an MSA using SMTP
AUTH. DECLARATION OF INDEPENDENCE
At present, many Mail User Agents (MUAs) are configured MUA: (n) Mail User Agent. What the end-user thinks of as “my email program” and
what ISPs think of as “the email client”. Popular MUAs include Eudora, the Outlook
to submit messages to a Mail Submission Agent (MSA) over family, and Mac Mail. Determines what the end-user sees of an email message. The
port 25. The MSA accepts the message because the ip address entity responsible for signing and verifying S/MIME cryptographic authentication.
of the MUA is trusted. Possibly also the entity responsible for verifying Sender ID (PRA) authentication.
At present, any host on the net can claim to be a Mail Trans- MTA: (n) Message Transfer Agent. What ISPs think of as “the email server” and what
end-users often don’t think of at all. Popular opensource MTAs include Sendmail,
fer Agent (MTA). Open relays, open proxies, and zombies Postfix, Qmail, and Exim. Popular commercial MTA vendors include Sendmail,
are hard to distinguish from “official” MTAs run by respon- Openwave, Ironport, Microsoft Exchange, and others. Can operate as a sender or as a
sible entities. Numerous DNS Block Lists (DNSBLs) attempt receiver. When receiving, responsible for verifying SPF and other authentication.
to identify the offenders, but they are inherently limited to MSA: (n) Message Submission Agent. What an MUA thinks of as an “SMTP server”.
Usually set up by an ISP to receive mail from end-users. Often whitelists the dialup/
a reactive mode of operation. Furthermore, inaccurate list- broadband range. May also be the outbound edge MTA. Unlike a receiving MTA,
ings often cause “collateral damage,” and they can be hard to must require SMTP AUTH when accepting connections from outside trusted network.
correct. Finally, playing “whack-a-mole” with 4.3 billion IP See RFC2476.
addresses is a difficult scaling problem. On the flip side, ISPs Zombie: (n) An end-user machine under the control of a virus, often used to send
spam. It is estimated that up to one in three machines might be infected with worms
may maintain lists of IP addresses of known good senders. and viruses. Zombies can send spam direct-to-MX or routed through an ISP MSA.
Maintaining those lists is a time-consuming endeavour.
The vision calls for accountable participants in the email
system to • authorize certain MTAs as designated senders,
�������� �������
• add cryptographic signatures to outgoing messages, or • do ���� ����
both. ip-based authentication lets receiver MTAs distinguish ��� ��� ��� �������
�����
accountable MTAs from hijacked machines. Crypto-based �������������
authentication lets receivers authenticate message content �������������
������������
without reference to the sending mta. The two approaches ��������
���
��������� ��������
���
��������
are complementary and reinforce each other. Both involve ����������
publishing records in DNS.
An authorized outbound edge MTA transfers a message to Edge MTA: (n) On the sending side, an MTA which takes the role of an SMTP client to
the public Internet. On the receiving side, a server MTA which accepts connections
an inbound edge MTA. from the public Internet from sending MTAs.
about senders.
All senders can authenticate themselves. Spammers will too. Today, many ISPs keep local whitelists and blacklists.
These lists are not shared with their peers, and so
Therefore authentication checks alone are not sufficient. their utility is limited. Many ISPs also use public
The vision calls for the receiving MTA to also decide if it whitelists and blacklists.
likes or dislikes the sender. This decision can be based on
a purely local opinion. It can also be informed by opinions
from third parties.
If you are in my addressbook, I would probably be happy to In fact, if you’re in my best friend’s addressbook, I
would probably be happy to read mail from you.
read mail from you. Emerging technologies such as LOAF (http://loaf.
The vision calls for the receiver’s mua to help distinguish cantbedone.org) and http://www.web-o-trust.org/
wanted mail that passes authentication from unwanted mail are good examples of experiments in this space.
At present, reputation services exist in the form of DNSBLs. A useful review of many blacklists can be found at
http://www.sdsc.edu/~jeff/spam/Blacklists_Compared.html
They are based on IP address and generally assert an opin-
ion that a given IP address should be blocked. Accreditation
services also exist in the form of DNSWLs. They vouch for Reputation service: (n) offers opinions about senders, usually based on
empirical observation of past behaviour. Operates on behalf of receivers.
assertions made by legitimate senders who care very much May be expressed as spamtrap counts, a binary vote, a ratio of complaints to
about deliverability. They may be backed by some kind of total message volume, etc. Receivers need to decide for themselves what
financial bond. opinions mean.
Examples: movie reviews, DNSBLs (Spamhaus, Spamcop).
The vision calls for these services to also • keep track of
senders by domain name and to • indicate if, and why, certain Accreditation service: (n) offers assertions about senders, usually based on
representations made by senders. Operates on behalf of senders. May be
domains should be considered good. This makes it possible expressed as a list of reasons for predicting future behaviour.
for receivers to recognize known good senders and confer a Example: “rated R”, Bonded Sender, Habeas, Verisign VDL.
sort of “first-class” status to their messages. Messages that How to tell the difference? Very crudely: follow the money! If the sender
pass the joint test of authentication and reputation can then pays to be listed, it’s accreditation. If the receiver pays them for their
choose to bypass other more expensive and potentially error- opinions, it’s reputation.
The vision calls for receiving MTAs to record attach au- �������
���������������
thentication and reputation metadata to messages. The most �������� ��������������� ��������
natural place to put that data is in the headers. Spammers ��� ���
An Example
Google Mail (gmail.com) is an early and enthusiastic adopt- Sendmail, Inc is another enthusiastic pioneer in sender authentication. See
http://www.sendmail.net/ for details on the Messaging Integrity Pilot Program.
er of sender authentication technologies. They publish spf
records and sign messages with DomainKeys. Here are some
headers from a message they sent from mengwong@gmail to
[email protected]:
Delivered-To: [email protected]
Received-SPF: pass (dumbo.pobox.com: domain of [email protected] designates 64.233.170.199 as permitted sender)
Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.199])
by dumbo.pobox.com (Postfix) with ESMTP id 9C02E198
for <[email protected]>; Wed, 27 Oct 2004 23:09:16 -0400 (EDT)
Received: by rproxy.gmail.com with SMTP id 80so309rnk
for <[email protected]>; Wed, 27 Oct 2004 20:09:12 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
s=beta; d=gmail.com;
h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding;
b=Vlj/++WbtRXfAdBGd+9GjE2ggK8e5Fwe2H68kpHOh7yFu9NHrRwjAeWpcar84+s+UWEsTWLLBdwGnabOfLeGOlOLSdxeUbrQ4ibPO
QUOF10ZkalycNmrpG3tIvuE5ta9w1+kLEwJs1d7PJU24XyBsqp+mdyMWT6mroXi0GXzBps=
Received: by 10.38.98.18 with SMTP id v18mr773189rnb;
Wed, 27 Oct 2004 20:09:12 -0700 (PDT)
Received: by 10.38.8.32 with HTTP; Wed, 27 Oct 2004 20:09:12 -0700 (PDT)
History
In 998 Jim Miller had the idea of designating outbound There was another bookish lad in the town, John
mailers. In 2002 Paul Vixie wrote up the idea in a paper Collins by name, with whom I was intimately
titled “Repudiating Mail-From”. In 2003 Hadmut Dan- acquainted. We sometimes disputed, and very fond we
isch independently authored a specification called “Reverse were of argument, and very desirous of confuting one
MX” (RMX). Around the same time, Gordon Fecyk wrote another, which disputatious turn, by the way, is apt to
a similar specification called “Designated Mailer Protocol”
become a very bad habit, making people often extremely
(DMP). Later that year Meng Weng Wong combined some
features of RMX and DMP into SPF. SPF originally stood disagreeable in company by the contradiction that is
for Sender Permitted From, but changed its name to Sender necessary to bring it into practice; and thence, besides
Policy Framework. Microsoft® also wrote a specification, souring and spoiling the conversation, is productive of
“Caller-ID for Email” (CID), as part of a Coordinated Spam disgusts and, perhaps enmities where you may have
Reduction Initiative proposal (CSRI). While they differed in occasion for friendship. I had caught it by reading my
a number of ways, all of these proposals shared the concept father’s books of dispute about religion. Persons of good
of using dns records to authorize smtp clients to be mtas. sense, I have since observed, seldom fall into it, except
While all this was going on, Yahoo!® was developing a lawyers, university men, and men of all sorts that have
crypto-based approach, called DomainKeys (DK). In early been bred at Edinborough.
2004 rough consensus appeared in the email industry to
Autobiography
proceed with both ip-based and crypto-based approaches.
To make things easier, Microsoft® and Meng worked to BENJAMIN FRANKLIN
merge cid and spf into a single proposal in the marid work-
ing group of the ietf. Work began in earnest in May and a
converged specification was concluded in October under the
name Sender ID™.
SPF records use a simple syntax which any dns administra- SPF features a “best-guess” technology which basically says: if a
domain does not publish SPF records, try “a/24 mx/24 ptr” anyway.
tor should find intuitively familiar. Records are easy to set up If that returns a PASS, consider that PASS a useful first approximation.
by hand. Here is an example record: v=spf1 mx This technique significantly reduces the deployment burden for
It means that the mx servers for the domain are explicitly technologically unsavvy senders who are lucky enough to obtain a
PASS using best-guess alone.
permitted to send mail from that domain.
SPF Check: (n) a test of the validity of an IP address against a domain name. If the
domain name comes from the return path, you’re doing an SPF Classic or SPFv1 check.
How SPF Classic Works If it comes from the PRA, you’re doing a PRA check.
Every smtp transaction begins with a mail from command. If the MAIL FROM is empty, SPF Classic falls SPF record: (n) a v=spf1 record.
back to the HELO argument. This is useful for spf2.0 records are for special cases
SPF Classic examines the return-path identity given in the handling bounce scenarios and closes a only. (Caller-ID records using the
mail from command. It tests the client ip against the spf re- loophole whereby spammers could just send XML format are no longer used.)
cord for the domain in the return-path. As it focuses on the mail with a null MAIL FROM.
return-path, SPF Classic is most obviously useful for helping Bottom Line: The SPF records that you create need to work in
both MAIL FROM and HELO contexts. Someone might be
fight bounce floods caused by undeliverable forgeries. But it looking at your SPF record because your domain showed up in
is also useful in cases where the recipient of a forgery is deliv- a MAIL FROM, or because the MAIL FROM was blank and your
erable. Even though the forgery may not result in a bounce, domain showed up in the HELO. If none of your servers
HELOS using a given domain name, then you only have to
some harm can still be prevented. worry about MAIL FROM use of that name. If you’re setting up
an SPF record for a hostname, you probably do want to ensure
the record will work for HELO. You can do this easily by
How Sender ID works adding an “a” mechanism.
When an mua displays a message, it shows who sent the Politics. Some have characterized Sender ID as “SPF with PRA bolted on.” The IETF
community has roundly criticized the PRA on both technical and licensing grounds.
message, usually by extracting the From: header. Every well- Some members of the technical community assert that the very idea of using PRA for
formed email message contains a From: header. But a mes- header validation is flawed. Other observers comment that the patent license which
sage may also contain a Sender: header. In that case, an mua surrounds PRA makes it unpalatable to implement.
A potential security vulnerability may occur if an MTA validates a PRA address which
may say to the end-user “From Sender on behalf of From”. is not actually displayed to the end-user. If an upstream MTA validates the PRA and
The PRA is Microsoft took this concept one step further and defined the records the authentication results in a header, and if an MUA displays that authentica-
drawn not just tion result as a mark of confidence, that MUA must be very careful to also display the
from the From
Purported Responsible Address (PRA). A Sender ID com- validated address to the end-user. Until more MUAs display the PRA, the author expects
and Sender pliant mua displays: “From PRA on behalf of From”. Sender few MTA software engines to implement PRA checking. Commercial MUA software,
however, will probably find it useful, at least until cryptographic solutions designed
headers, but ID as originally conceived runs an spf test, but uses the PRA expressly for 2822 content checking mature.
from the
Resent-From instead of the mail from. At least one major commercial MUA vendor has publicly stated it will proceed with
and Resent- Sender ID was recently resubmitted to the IETF. It now PRA checking. Microsoft appears to be preparing to turn on Sender ID checking in
Sender Hotmail, Outlook, and Exchange. The latest versions of Outlook are expected to display
headers as well.
specifies that both the return-path and the PRA may be used. the PRA where available, rather than just the Sender header.
See the Sender Software that implements only SPF Classic can therefore be Sendmail, Inc. has released experimental milters for Sender-ID that check both the
ID specifica- MAIL FROM (SPF Classic) and the PRA. Other commercial MTA vendors have done the
tion for details.
called Sender ID compliant. In practice, most people associ- same. Generally, however, SPF Classic is more widely supported than PRA at this time.
ate Sender ID with the PRA, and SPF Classic with the mail
from, or return-path. The Patent Situation. Microsoft has two patents pending on Sender ID. While the
patent license offers Royalty Free terms, according to Lawrence Rosen Esq., the
The author recommends that mua software implement sublicensing provision of the patent license makes PRA incompatible with GPL free
Sender ID with pra checking. The author recommends that software such as Exim. Apache SpamAssassin, for example, have stated that they will
mta software implement Sender ID with mail from check- not implement PRA checking, and will stick to SPF Classic in version 3.0 and above.
Note that the patents only cover the PRA and do not restrict SPF Classic in any way.
ing, aka SPF Classic. The author also recommends watching Some individuals are planning to work with http://www.pubpat.org/ to challenge the
to see how crypto develops. patent on grounds of prior art and obviousness.
All cryptographic approaches to authentication agree on the ���������������� ���������������� �������� ������������������
��������������������� ���������������
basic concept: sign some portion of the message content and ��������������������� ����������� �������
������������������
�������������
present that signature for verification. The approaches dis- ���������������������� ��������������������
agree about what gets signed, where the signature goes, and �������������������� ������
���� �����
����������� ��������
how verification is done. ��������������
PGP and GPG sign the message body only and put the
������������������������������������������������������������������
signature directly in the body. Keys are stored in end-user
���������������������
keyrings or in public keyservers; key management uses a
peer-to-peer web-of-trust architecture. The signature in- �����������������
cludes a description of the signing entity, but muas tend not
����������������
to use that author data from the signature to override the ������������������
����������
S/MIME signs the message body also, but presents the ������������ ������������ ��������������� �������������
signature in a logically distinct mime part. Keys are signed ���������������� �������������� ������������� ���������
������������ ��������������� ������������������� ������������������
by a certificate authority, so key management follows a hier- ������������������� ��������������� �������� ������������������
archical model similar to ssl. Signatures that do not match ���������������� ����� ����������
����� ������������������
the From: header tend to result in some sort of mua user in- �����
terface warning.
DomainKeys, originally championed by Yahoo!, signs
the body and some message headers. It puts the signature PGP and S/MIME have been around for a long time, but they are not widely used.
While most MUAs today support S/MIME natively, the vast majority of mail sent is not
in a DomainKey-Signature header. Keys can be self-signed, signed. Why not? I don’t know. Maybe the average end-user doesn’t sign their
as in PGP, and published in dns following a decentralized, outbound mail because they find it inconvenient to manage keys and enter
opportunistic encryption model. If a message fails signature passphrases. But why don’t the bulk mailers, even the well-organized volume ESPs,
sign their mail? Maybe they perceive a significant population of MUAs that don’t
verification, it should be rejected by the receiving mta dur- support S/MIME, and fear customer complaints. I am not aware of any published
ing smtp time, but in practice will probably result in some results that give a basis for this fear.
sort of warning sign in the mua. In 999, the US Department of Defense published a policy mandating future use of
BATV signs the return-path only and places the signature PKI technologies. They chose S/MIME over PGP because they rejected the PGP web of
trust model in preference for the hierarchical Certificate Authority model. Use of
in the return-path. If a sender always batv signs its return PKI certificates to access DoD restricted access web sites became mandatory October
paths, any bounces that come to a non-batv-signed address , 2004. The DoD may similarly mandate S/MIME for email in the future.
must be bogus. Though there is provision for a public mode,
BATV primarily uses a private-secret key scheme because See http://mipassoc.org/batv
only the signing system absolutely needs to authenticate its
signatures. BATV is a lot like VERP, but with a signature. Mailing lists use Variable Envelope Return Path to track bouncing subscribers.
The latest evolution of SES also places the signature in See http://ses.codeshare.ca/
the return-path, but signs the message headers and body as
well, much like DomainKeys. SES also uses a private-secret
key scheme, but validation can occur at smtp time! How?
The sender system publishes an exists mechanism using Bottom line: cryptographic signing is performed by the MTA. In IP-based protocols,
senders have to go fiddle with DNS. With crypto, senders have to put their public keys
SPF; that mechanism instructs receivers to include the full in DNS, and also have to upgrade to an MTA that supports signing.
localpart in a dns query against the sender. When the send-
er’s dns server gets a query, it validates the signature. If a
sender system signs all outgoing mail with SES and runs a
custom SES-enabled dns server which can validate localpart
queries, it no longer needs to worry about forwarding false
positives.
Jim Fenton’s Identified Internet Mail is similar to DK. IIM repeats the signed headers within the headers. This is better for mailing lists. It
also includes the public key with every message. DK and IIM are similar enough that
Microsoft’s Email Postmarks is essentially mta-to-mta many industry insiders hope and expect them to merge in early 2005.
S/MIME which may be easier to implement in Exchange.
The IETF MASS SIG has engaged the above proposals. See http://www.imc.org/ietf-mailsig/index.html and
http://www.elan.net/~william/emailsecurity/emailsignatures-comparisonmatrix.htm
�
receivers rely on reputation systems. ��������
A detailed discussion of reputation systems is outside the
scope of this white paper. But here is the main point: first-
����������
generation reputation systems tried to enumerate all the ip
�
���� ����
addresses which they considered bad. Next-generation rep-
�������
utations will try to enumerate all the domain names which
they consider good. There are many ways to do this. All of �
them are interesting.
What if a domain has no reputation? If it is patient, it can ��������
��������
gradually acquire one simply by sending enough good mail �� ��
to be noticed over time. After all, sensible receivers should
not reject outright mail from senders without a reputation; ����������
receivers might just graylist or filter more aggressively. But if
the domain is impatient or wishes to refute a bad reputation, ���� ����� ����
it may choose to sign up with an accreditation service.
�
��� ��
The Karma Project is an aggregation BondedSender.com and Habeas are ��������
service which reduces the burden on examples of services which vouch on ��������
receivers. Instead of talking to N behalf of senders.
services to get N results, receivers can
talk to a single service to get N results. If a sender domain publishes and signs
Please contact the author for details ������ using both IP-based and crypto-based ������
on feeding into and reading from the methods, and if a receiving domain finds
Karma system. that neither method passes, it can be very
confident that the message is a forgery.
First, prepare.
Audit Your Outbound Mailstreams Under DomainKeys: you need to audit your outbound mailstreams too.
tax. A number of wizards are available online to help you Here are some examples of how sender.com’s SPF record might look:
create your spf record. If you have a complex configuration, sender.com TXT “v=spf1 a:corp.sender.com a:smtp.sender.com ?all”
sender.com TXT “v=spf1 a mx ~all”
you should see the SPF protocol specification for full details. sender.com TXT “v=spf1 ip4:192.0.2.0/24 -all”
is complex and you routinely create messages whose mail Under DomainKeys: DK deals only with 2822 information, and
with only the From: and Sender: headers. It leaves 282
from and pra differ, you may need to create an spf2.0/pra validation to SPF. One might say that DomainKeys attempts to
record as well. In that case, your record might look like: validate authorship, and SPF Classic attempts to validate the last
v=spf1 a:corp.sender.com a:smtp.sender.com ~all hop sender.
spf2.0/pra ip4:192.0.2.0/24 ~all
Figuring out your spf record is the first step, but how do you
know it’s doing what you want? There are a number of spf
validation tools on the web. You paste your proposed spf Some validation tools are listed at
http://spf.pobox.com/certification.html
record into the tool, and it tells you whether it’s syntactically
correct.
SPF records are published in dns as txt records. There are A new Resource Record type is being assigned, but
adoption of new RR types is generally held to be a
two common scenarios: domain hosting and direct control. slow process. So SPF records make do with TXT,
If your domain is hosted, your hosting provider should which is widely supported and not explicitly reserved
offer a web interface. Most hosting providers have started for anything else.
offering a txt option so customers can publish spf records. A list of hosting providers which support TXT records can be found
at http://www.spf.idimo.com/txt-supporters.html
If your domain hosting provider does not, you may want to
transfer management of your domain to another provider,
or petition them to add support for txt.
If you run the nameservers for your domain, you ought There is no central registry for publishing SPF
information. Your SPF record is published directly in
to be familiar with editing zone files. Common nameserv- the DNS for your domain, which ultimately you
ers include bind and djb’s tinydns. An spf record in a bind control.
zonefile might look like this:
sender.com. IN TXT “v=spf1 ip4:192.0.2.0/24 a mx ~all” Under DomainKeys: messages acquire an
additional header that signs the message content.
The equivalent record in tinydns might look like this: For the example on p 9, the corresponding public
ʼsender.com:v=spf1 ip4\072192.0.2.0/24 a mx ~all:300 key appears in DNS:
You can confirm that the record appears in dns by using ns- beta._domainkey.gmail.com. IN TXT
“t=y; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC69TURXN3oNfz+G/m
lookup or dig. Until you’re comfortable with the record, 3g5rt4P6nsKmVgU1D6cw2X6BnxKJNlQKm10f8tMx6P6bN7juTR1BeD8ubaGqtzm2rWK4Li
you should keep the ttl low, so you can change it quickly MJqhoQcwQziGbK1zp/MkdXZEWMCflLY6oUITrivK7JNOLXtZbdxJG2y/
RAHGswKKyVhSP9niRsZF/IBr5p8uQIDAQAB”
if you need to.
Getting your spf record into dns is a big step. Now every-
body can read it! Again, you should use a validation tool to You should also register your newly SPF-enabled domain at
the online registry. Go to http://www.spftools.net/ where
check it. But this time, instead of pasting your record into over 200,000 other domains have self-registered. By some
the validator, you just give it the name of your domain. The estimates, the true number of SPF-enabled domains has
validator fetches the record from your dns directly and con- already crossed the one million mark.
The macros %{s} and %{i} expand to the sender address and Macros: the macro feature lets you insert data into the
domain arguments for mechanisms. %{i} expands to the
the client ip address, respectively. client IP address. %{s} expands to the full sender email
You may find that you have legitimate end-users using an address. See the Protocol Specification.
outbound gateway you had not previously identified: maybe
they’re using some third-party smtp server, or maybe you If you don’t want to set up DNS logging yourself, you can
use a third-party logging service.
didn’t know about a legal outbound route. Setting up a log- See http://spf.pobox.com/certification.html
ging exists helps you discover these cases. In the first case,
where an end-user is using an unapproved smtp server, your Dear Customer,
isp.com prides itself on keeping up to date with the latest security
job is easy: tell the end-user that for security reasons he now practices. As part of our work with our peers and partners to help fight
needs to use sender.com’s smtp gateways to send sender. spam, we are strengthening our security policies. We appreciate your
com mail. In the second case, you can just add the new out- cooperation in making the following changes:
– please ensure that your SMTP server is set to smtp.isp.com port 587…
bound gateway to your spf record. – please run Windows Update…
When you send mail from your [email protected] address, it is important
that you send it through isp.com’s SMTP servers. This helps authenticate
Loose Ends: Publishing Records For Hostnames your messages and ensure that they are correctly delivered. If you send mail
through any other SMTP servers, antispam software on the receiving end
may classify your messages as spam.
This example has demonstrated how to publish an spf record
for sender.com that works for both SPF Classic and Sender
ID. That’s an excellent start, but it doesn’t end there! Your
primary domain name is certainly the first thing you should
take care of. But to be really thorough, you should put spf
records on the hostnames under sender.com.
In this example we’ve seen two hosts: corp.sender.com
and smtp.sender.com. Both are used for outbound relaying:
they send mail from addresses at sender.com. But they may
also send non-delivery notifications (NDNs) directly. Mes-
sages from mailer-daemon are typically addressed from the
hosts themselves, and look like this:
If a message cannot be delivered, it is queued for later re- Deferral Relaying: when a message is not immediately deliverable, queue it on a
dedicated retry server instead of on your main sending server.
try. All sane senders do this. But some sites practice deferral
relaying: instead of queuing undeliverable messages on the
sending server, they move messages to a different machine. If deferrals.sender.com also sends mail that looks like this:
This is done for performance reasons. The main sending MAIL FROM:<[email protected]>
From: Some User <[email protected]>
servers don’t get clogged with queued messages, and the de-
ferral servers can focus on retrying messages at a more lei- Or like this:
surely pace. MAIL FROM:<>
From: Mail Delivery Subsystem <[email protected]>
If sender.com practices deferral relaying, you should add
its deferral relays to its spf record. We could update the previous examples to say:
corp.sender.com TXT “v=spf1 a a:deferrals.sender.com -all”
smtp.sender.com TXT “v=spf1 a a:deferrals.sender.com -all”
To Fail or not to Fail? sender.com TXT “v=spf1 a mx a:deferrals.%{d2} ~all”
If you look at other sites with spf records, you’ll find that
some of them end in ?all, some of them end in ~all, and
some end in -all. What should you do? If… then set
It depends. This is a tradeoff situation: you have to bal- Deliverability is mission critical… ?all
ance competing concerns. Conservative publishers might Phishing is a major concern… –all
start with a ?all, move through ~all as conditions change, Your users are still using 3rd party SMTP servers… ?all
and (if all goes well) stabilize at -all. (“Conditions change” All users are known to be compliant… –all
means users switch to the approved outbound smtp relay, You are worried about non-SRS forwarders… ?all
forwarders start prepending headers and implementing srs, “Enough” forwarders have adopted SRS… –all
and you start signing with DomainKeys.) If you are very con- (or you want to encourage them to)
cerned about phishing, publish a –all right away and accept The domain never sends mail… –all
that there may be some false positives due to noncompliant You need something in between ?all and -all… ~all
forwarders who are slow to upgrade. Otherwise, use a ~all. Yes, this is yucky. I’m sorry. I wish it weren’t. –Meng
If a joint test shows that the sender is trusted and the message The industry hasn’t yet standardized on a way to do
this. Murray Kucherawy of Sendmail has drafted a
is authentic, a receiving system should communicate that fact specification for an Authentication-Results:
to end-users. A receiving mta should record the test results header. I haven’t heard any complaints to date.
in a header for consumption by a downstream mua.
������������
Outbound Port 25 blocking restricts direct-to-mx spam �������������
����������������
��������
from zombies. isps should block port 25 outbound on con- ��������������
sumer-class connections by default. (Customer churn is
always less than feared.) If a customer needs the port un-
blocked, isps can do so on a case-by-case basis or offer a dif-
������
ferent class of service. Business-class connections should
leave port 25 unblocked by default under the assumption ������� ��������������
����������� ���������
that customer organizations – acting as isps themselves – run �������������� �����������������
their own mtas and internally block port 25. �������� ���������������������
�������������� ����������������
���������� ������������
Inbound Port 25 blocking is also strongly recomended to ������������� ����������������
counter asymmetric ip routing attacks. ������� �����������
����������������������������
Offering smtp auth is essential for roaming customers
who, in the stricter world of sender authentication, need to
connect back to their home isp to send mail. smtp auth
should be offered on port 587 because a roaming user might
not be able to reach port 25. Encryption should be manda-
tory: the starttls option is widely supported. cram-md5
and port 465 are good alternatives.
Consistent Reverse DNS Naming gives receivers a way If the IP address appears in the hostname, together with a Some common
distinctive subdomain name, lots of people will recognize subdomains:
to guess if a host is a zombie or a legitimate outbound mta. that as a consumer-class broadband machine that should dsl · adsl
Consumer-grade machines should reside under a specific not send mail. Conversely business-class accounts should cable · cablemodem
subdomain. Production mxes should never contain their ip get their choice of reverse DNS naming, and the PTR cust · customer
hostname should resolve back to the actual IP. dial · dialup
address in the hostname and must have consistent forward dyn · dynamic
and reverse dns. Some filters are unable to cope with embedded wildcards ppp · pppoe
so the distinctive tag should appear on the right hand side. broadband
Which specification? The nice thing about standards is that there are so many
to choose from. Furthermore, if you do not like any of
One half of Sender ID is SPF Classic. The original SPF Clas- them, you can just wait for next year’s model.
sic specification was frozen in early January 2004. It has ANDREW S. TANENBAUM
evolved in only minor details since then. It was submitted
to the IETF in October 2004 and is expected to be published
as an experimental rfc. When it is published, mta vendors
are encouraged to update their implementations to match it. See http://spf.pobox.com/rfcs.html
Vendors who implement SPF Classic can indicate that they
are Sender ID compliant.
The other half of Sender ID is the PRA check. MTA ven- See http://www.microsoft.com/senderid
dors may also wish to implement that half. Specifications
describing the PRA and how it fits into Sender ID were sub-
mitted to the IETF in October 2004 as well.
Conformance testing
When automatically forwarding mail, mtas should do two See http://spf.pobox.com/srs.html and http://www.libsrs2.org/
things: rewrite the return-path using srs, and prepend a Re-
sent-From header.
SPF and Sender ID developers are strongly encouraged to See also http://spf.pobox.com/developers-guide.html
send mail to [email protected].
Displaying Authentication-Results
Delegation
DNS comes with a delegation feature. Use it! Suppose your In the example below, bigbox.com’s DNS admins have delegated esp.bigbox.com to
esp.com, so esp.com’s nameservers are the ones that actually answer authoritatively
client is bigbox.com, and you’re esp.com. You should try to for esp.bigbox.com. This makes it easier for esp.com to fiddle with esp.bigbox.
get the client to set up esp.bigbox.com which delegates to com’s SPF records and whatever else. The alternative to delegation is the infrequent
you; you can then use esp.bigbox.com in your mailings with and troublesome need for ESP to call BigBox once every eighteen months or so
when the DNS details change.
full control of the dns.
If your client is too small or too unsophisticated to set up
delegation, and if they just want you to use their name direct-
ly in their mailings, you’ll need to get them to “include:”
you in their spf record.
Publish Appropriately
ESPs are the one sector who might need to distinguish pra
and mail from scopes. We’ll walk through an example.
Suppose an ESP, esp.com, has been contracted by a cli- The author recommends that ESPs set up their mailings to look like this:
ent, bigbox.com. The ESP sends mail using through a server, MAIL FROM:<[email protected]>
From: Big Box Stores <[email protected]>
outmta.esp.com. Bounces and unsubscribes are directed to
Sender: <[email protected]>
bounces.esp.com. Reply-To: <[email protected]>
If you wanted to distinguish PRA from mail from scope, The PRA algorithm selects the Sender header.
you might use the following records:
1 bounces.esp.com Line 2 is for the MAIL FROM. The default is “?all” because for this mailing campaign and
2 “v=spf1 a:outmta.esp.com ?all” this domain, bounces.esp.com, we’re more concerned about mail getting through than
3 “spf2.0/pra -all” about preventing forgeries. Line 3 is for the PRA. It states: we’ll never use the domain
bounces.esp.com in a From: or Sender: header, only in the envelope.
4 bigbox.com Line 4 is for the client, bigbox.com, which outsources all of its marketing mailings and
5 “v=spf1 a:corp.bigbox.com -all” only uses bigbox.com for corporate accounts. it is more concerned about phishing than
false positives due to forwarding, so it sets -all.
6 esp.bigbox.com Lines 7 and 8 are for the outsourced relationship domain esp.bigbox.com. it indicates
7 “v=spf1 -all” that ESP is a contractor for bigbox.com. esp.bigbox.com is never used in the return-
8 “spf2.0/pra a:outmta.esp.com” path so the v=spf1 record is -all. But it is used in the Sender header, so the spf2.0/pra
record overrides it to allow outmta.esp.com. The PRA record does not end in a -all
ESPs who feel in need of further guidance are because, again, for this mailing we’re more concerned about mail getting through than
about forgery prevention.
welcome to contact [email protected] directly.
In the relatively near future, a sea change will occur so that Note to civil libertarians: you can be accountable and anonymous at the same time.
We’re interested in getting identities on the Internet to persist long enough to attract a
mail from senders who are not accountable will be widely stable reputation. We’re not quite as interested in tying online identities to real-world
relegated to third-class status. identities, because support for whistleblowing is an important social value. But we want
Some receivers may look down on messages from senders to give receivers the ability, when faced with a range of messages from senders they
don’t know, to apply an ordering to those messages so that senders who have taken
who do not have SPF or DomainKeys. To be on the safe side, steps to distinguish themselves from spammers get some kind of priority over senders
spammers should publish and sign. who have not taken those steps. A sender might voluntarily choose to tie their online
identity to their real-world identity in the hopes of improving their deliverability;
however, that decision should be entirely up to senders, and there should be ways for
Stop forging random domains. senders to distinguish themselves from spammers without requiring real-world
identification.
Sure, you could forge domains that don’t have SPF records,
but after a while receivers will adapt by simply third-classing
mail that doesn’t authenticate. So this is only a temporary
measure.
There are two main strategies. You could buy a domain, According to some reports, over a thousand domains are registered each week and used
to spam.
bring it online, and immediately spam with it. This works
because reputation service won’t know anything about those
new domains, so if the receiver has a default-accept orienta-
tion, the mail might still get through. As this strategy evolves,
receivers might learn not to accept mail from brand new do-
mains. This leads to the second strategy: buy a domain, leave
it mostly dormant for some time, and then spam with it in
hopes that it’ll now look more reputable than a brand-new
domain. Because most new spam domains are bought with
stolen credit cards, this strategy may be more costly unless
Spread FUD about the edge cases. FUD: (n) Fear, Uncertainty, and Doubt.
Publishing SPF: At the maawg First General meeting on Q4 2004 Senders and isps publish spf records.
November 2 2004, a majority of members voluntarily agreed
Q1 2005 maawg spf testing continues.
to publish spf records by the end of December 2004. It is up
dns hosters support txt records.
to each member to decide which default to use. Most con-
servative members may wish to use ?all (neutral) at first; Q2 2005 Forwarders do srs and prepend Resent-From.
that’s fine. More aggressive members may wish to use ~all muas display confidence to end-users with
(softfail). See the tradeoffs on p 5. foldering to first-class and business-class.
isps offer 587 smtp auth for roaming users,
Support for TXT: Managed dns providers should support tell new subscribers to configure that way by
txt entries by the end of q 2005. Providers should link to a default. Cryptographic solutions mature.
well-known third party wizard instead of offering their own. Q3 2005 spf results widely used in spam scoring.
Senders start signing outbound mail and
Crypto Signing: Some members are planning to sign mes- transition spf records to ~all or –all.
sages with DomainKeys on an experimental basis in 2005 as Receivers check inbound signatures and
their mta software develops this capability. honour fails by rejecting.
Q4 2005 isps offer default-reject mailboxes.
Checking SPF and DomainKeys: A testing and evaluation Spam ends. Bill Gates gets credit.
program is underway. maawg members expect to start spf
testing incoming mail in q 2005 and to incorporate the re-
sult into spam scoring decisions in q2 2005. DomainKeys Note: the above deployment dates are the author’s
checking should occur close to that timeframe also. recommendations. They are still incomplete, subject
to further development and discussion, and have not
Forwarder SRS: Forwarders should perform SRS on for- been ratified by any industry standards body. How-
warded mail and prepend headers by the end of q2 2005. ever, if you wait for industry standards bodies to ratify
things, you may be waiting a really long time. That
Honoring Authentication Failures: If a sender domain uses said, you should consider joining maawg, which is a
a –all default, and if a receiver domain obtains a fail result, forum for collaboration and standards deployment in
that receiver may reject the message during the smtp trans- the messaging space. (http://www.maawg.org)
action. It should not generate a bounce message. In q3 2005,
senders should set –all defaults, and receivers should move To stay current on these issues, join the deployment
to begin to honour –all by rejecting. Senders who are par- mailing list by sending mail to subscribe-spf-
ticularly concerned about noncompliant users or forwarding [email protected].
false positives can define a ~all default.
See also the maawg Code of Conduct document and the Code of Conduct document currently being revised.
ASTA Technical Recommendations document. ASTA doc available at http://docs.yahoo.com/docs/pr/pdf/asta_soi.pdf
3.2 Conversely, dynamically assigned consumer-grade ips IP addresses may be encoded in decimal or in hex.
For example, 192-0-2-2.adsl.example.com or
should obviously contain two or more octets of their ip ad- c0000202.adsl.example.com
dresses in their ptr hostname. See p 7.