How a spoofed email passed the SPF check and landed in my inbox

The Sender Policy Framework can’t assist forestall spam and phishing if you happen to enable billions of IP addresses to ship as your area

Twenty years in the past, Paul Vixie printed a Request for Comments on Repudiating MAIL FROM that helped spur the web group to develop a new method of preventing spam with the Sender Policy Framework (SPF). The concern then, as now, was that the Simple Mail Transfer Protocol (SMTP), which is used to ship email on the web, offers no method of detecting solid sender domains.  

However, when utilizing SPF, area homeowners can publish area identify system (DNS) information that outline the IP addresses approved to make use of their area identify for sending email. On the receiving finish, an email server can question the SPF information of the obvious sender area to check whether or not the sender’s IP handle is permitted to ship email on behalf of that area. 

SMTP email and SPF overview 

Readers conversant in SMTP message sending mechanisms and how SPF interacts with them would possibly choose to skip this part, though it’s mercifully quick. 

Imagine that Alice at needs to ship an email message to Bob at Without SPF, Alice and Bob’s email servers would interact in an SMTP dialog one thing like the following, which is simplified utilizing HELO slightly than EHLO, however not in ways in which considerably alter the primary constructs: 

This is how sending and receiving web (SMTP) email has occurred since the early 1980s, nevertheless it has – at the very least by the requirements of as we speak’s web – a main downside. In the diagram above, Chad at instance.internet may simply as simply hook up with the SMTP server, interact in precisely the similar SMTP dialog and have an email message apparently from Alice at delivered to Bob at Worse nonetheless, there can be nothing indicating the deception to Bob, besides maybe IP addresses recorded alongside host names in diagnostic message headers (not proven right here), however these usually are not simple for non-experts to check and, relying in your email consumer software, are sometimes troublesome to even entry. 

Although not abused in the very early days of email spam, as mass spamming grew to become a longtime, albeit deservingly despised, enterprise mannequin, such email forgery strategies had been broadly adopted to enhance the possibilities of spam messages being learn and even acted upon. 

Back to the hypothetical Chad at instance.internet sending that message “from” Alice… That would contain two ranges of impersonation (or forgery) the place many people now really feel that automated, technical checks can or must be made to detect and block such faked email messages. The first is at the SMTP envelope degree and the second at the message header degree. SPF offers checks at the SMTP envelope degree, and later anti-forgery and message authentication protocols DKIM and DMARC present checks at the message header degree. 

Does SPF work? 

According to at least one study printed in 2022, round 32% of the 1.5 billion domains investigated had SPF information. Out of those, 7.7% had invalid syntax and 1% had been utilizing the deprecated PTR report, which factors IP addresses to domains. Uptake of SPF has been sluggish and flawed certainly, which could result in one other query: what number of domains have overly permissive SPF information?  

Recent research found that 264 organizations in Australia alone had exploitable IP addresses in their SPF information and so would possibly unwittingly set the stage for large-scale spam and phishing campaigns. While not associated to what that analysis discovered, I just lately had my personal brush with probably harmful emails that took benefit of misconfigured SPF information. 

Spoofed email in my inbox 

Recently, I acquired an email that claimed to be from French insurance coverage firm Prudence Créole, however had all the hallmarks of spam and spoofing: 


While I do know that forging the From: handle message header of an email is trivial, my curiosity was aroused once I inspected the full email headers and discovered that the area in the SMTP envelope MAIL FROM: handle [email protected] had passed the SPF check: 

So I regarded up the SPF report of the area 

That’s a enormous block of IPv4 addresses! accommodates 25% of the IPv4 handle house, starting from to Over a billion IP addresses are accepted senders for Prudence Creole’s area identify – a spammer’s paradise. 

Just to ensure I wasn’t kidding myself, I arrange an email server at dwelling, was assigned a random, however eligible, IP handle by my web service supplier, and despatched myself an email spoofing  


To high all of it off, I checked the SPF report of a area from one other spam email in my inbox that was spoofing 

Lo and behold, the block permits the complete IPv4 handle house, consisting of over 4 billion addresses, to move the SPF check whereas posing as Wild Voyager. 

After this experiment, I notified Prudence Créole and Wild Voyager about their misconfigured SPF information. Prudence Créole up to date their SPF information earlier than the publication of this text. 

Reflections and classes discovered 

Creating an SPF report on your area is not any loss of life stroke towards spammers’ spoofing efforts. However, if securely configured, the use of SPF can frustrate many makes an attempt like these arriving in my inbox. Perhaps the most important hurdle standing in the method of speedy, wider use and stricter software of SPF is email deliverability. It takes two to play the SPF recreation as a result of each senders and recipients have to harmonize their email safety insurance policies in case emails fail to be delivered as a consequence of overly rigorous guidelines employed by both aspect. 

However, contemplating the potential dangers and injury from spammers spoofing your area, the following recommendation will be utilized as applicable: 

  • Create an SPF report for all of your HELO/EHLO identities in case any SPF verifiers are following the recommendation in RFC 7208 to check these 
  • It is healthier to make use of the all mechanism with the or ~ qualifiers slightly than the ? qualifier, as the latter effectively allows anyone to spoof your domain 
  • Set up a “drop all the pieces” rule (v=spf1 -all) for every area and subdomain you personal that ought to by no means generate (internet-routed) email or seem in the area identify a part of the HELO/EHLO or MAIL FROM: instructions 
  • As a guideline, ensure your SPF information are small, as much as 512 bytes ideally, to forestall them from being silently ignored by some SPF verifiers 
  • Make certain you authorize solely a restricted and trusted set of IP addresses in your SPF information 

The widespread use of SMTP to ship email has created an IT tradition centered on transferring emails reliably and effectively, slightly than securely and with privateness. Readjusting to a security-focused tradition could also be a sluggish course of, however one which must be undertaken in view of incomes clear dividends towards one in all the blights of the web – spam.

Related Posts