Blocking forgeries and spam with SPF
[Posted October 22, 2003 by corbet]
Anybody who has spent any amount of time dealing with spam (i.e. just about
anybody
with an email address) knows that a great deal of it comes with forged
return addresses. Email worms attacking certain proprietary systems also
have a habit of generating mail with fake return addresses. If there were
a way to filter out mail with bogus sender addresses, a great deal of spam
and other unpleasant mail could be automatically removed from our
mailboxes.
A technique called "Sender Permitted From" (SPF) is being readied to
attempt to make this sort of filtering possible. Those looking for details
can find them in the draft RFC,
but the core concept is simple: the DNS database for each
domain should be augmented with information on which systems are authorized
to originate email for that domain. This information is added as a DNS
"text" record, so no changes to the DNS protocol are required.
So, for example, the DNS zone file for a domain which never, ever sends
mail could be made SPF-compliant by adding one line:
example.com IN TXT "v=spf1 default=deny"
The "v=spf1" portion indicates that this is an SPF version 1
entry, and the rest says to deny all mail from that domain.
In most interesting cases, however, people will want to be able to send
mail from a domain. So the SPF entry must be modified to tell mail
recipients which systems can send mail for the domain. The simplest way of
doing that, perhaps, is to simply state that the domain's MX servers can
originate mail:
example.com IN TXT "v=spf1 mx default=deny"
There are, of course, many ways of specifying, in great detail, exactly
which systems can legitimately send mail for the domain of interest; see
the RFC for details.
None of this will work until receiving systems perform SPF tests, of
course. One of the nice features of SPF is that the check can be done
before the body of a message is received. If the message will be filtered,
this filtering can be done at the SMTP level and a meaningful message
returned to the sender - if, indeed, there is a real sender. Patches exist
for a number of MTAs now; expect more as the SPF specification solidifies.
There are also plans to add SPF support in other places; apparently
SpamAssassin 2.70 will support it, for example.
SPF certainly will not solve the spam problem; spammers will just use
domains that lack SPF information, open relays, or throwaway domains of
their own. But it does place one more obstacle in their way, and will
doubtless reduce the flow somewhat. The real value of SPF may be in its
ability to make the forgery of email more difficult. In a fully
SPF-compliant world, Linux users would no longer be flooded with "virus
notifications" every time a new worm starts digging through peoples'
address books. A dedicated attacker would probably still be able to forge
email from a specific victim, but the days of easy, casual forgery would,
one hopes, be over. And that is worth something.
(
Log in to post comments)