Guida Red Sift alla configurazione dei protocolli email

image
Esplora la nostra guida

SPF failures: Hard fail vs Soft fail

What is an SPF failure?

An SPF failure occurs when the sender's IP address is not found in the SPF record published. Failures significantly affect the deliverability of your email as they result in the email being sent to spam or discarded altogether. This can be catastrophic for businesses that rely on email to reach customers.

There are two types of SPF failures - SPF softfail and SPF hardfail. A hardfail indicates that an email is not authorized, whereas a softfail means that an email has probably not been authorized. For the email recipient, it determines the treatment of the email; a hardfail tells the recipient to reject the email, whereas a softfail suggests it should be diverted to spam.

We will use two examples to demonstrate the visual difference between both.

SPF hardfail example

v=spf1 ip4:192.168.0.1 -all

In the above example, the minus symbol (in front of all at the end of the record) means that any senders not listed in this SPF record should be treated as a hardfail, ie. they are unauthorized, and emails from them should be discarded. In this case, only the IP address 192.168.0.1 is authorized to send emails and nothing else.

SPF softfail example

v=spf1 include:spf.protection.outlook.com ~all

In the above example, the tilde symbol (in front of all at the end of the record) means that any senders not listed in this SPF record should be treated as a softfail, i.e. mail can be allowed through but should be tagged as spam or suspicious. In this case, the include:spf.protection.outook.com mechanism authorized Microsoft 365 to send emails. Any emails originating from different servers should be marked as spam by the receivers. 

Not sure on your SPF setup? Use our free checker to get started.

Which SPF failure mode should you use?

Given that hardfail ("-all") signals to reject any unauthorized senders not found in the SPF record, it might seem like the mode of choice. However, the decision is more nuanced.

In a pre-DMARC era, SPF records commonly used the "-all" mechanism to strictly enforce sender policies, without the additional layer of DKIM and DMARC to help authenticate legitimate emails.

However, modern guidance now favors "~all" to balance security and deliverability, avoiding unnecessary rejection of valid emails that might fail SPF but pass DKIM and DMARC.

The wider industry echoes that care needs to be taken with SPF modes; the DMARC specification (RFC 7489) states that:

“Some receiver architectures might implement SPF in advance of any DMARC operations. This means that a "-" prefix on a sender's SPF mechanism, such as "-all", could cause that rejection to go into effect early in handling, causing message rejection before any DMARC processing takes place. Operators choosing to use "-all" should be aware of this.”

For these reasons, we would suggest the following

  • Use "-all" for inactive, non-email sending domains: Apply "-all" only if the domain sends no emails at all. This setting strictly blocks unauthorized emails but risks rejecting legitimate ones if the SPF record isn’t up-to-date.
  • Use "~all" for active, email-sending domains: Opt for "~all" if you’re using SPF in combination with DKIM and DMARC to combat phishing and spoofing. This is because “~all” - when implemented in combination with DMARC (at p=reject) - will still reject unauthenticated mail if SPF and DKIM fail. This mode does not block legitimate mail, thus enhancing overall email deliverability.

In summary, softfail strikes a balance between strict security (which might block legitimate emails) and allowing some flexibility in email delivery, ensuring that emails can still be delivered even if there are occasional mismatches in the SPF record.

How is SPF softfail treated by cybersecurity rating companies? 

It is possible that some rating companies may penalize you should your domains be set up with SPF softfail. However, we believe that downgrading a domain's security score based on the presence of a softfail can misrepresent the actual risk profile of the domain and inadvertently penalize organizations that are following industry-recommended practices for responsible email management and security.

On the other hand, rating services like Security Scorecard acknowledge DMARC (when set up in a policy of quarantine or reject) is a “compensating” control for SPF softfail.

If you are penalized for implementing SPF softfail in a cybersecurity audit, engage with the rating company directly to explain your email authentication strategy and its alignment with industry best practices. Advocate for a more nuanced approach to evaluating security postures, one that considers the full context of your email security measures rather than penalizing specific configurations in isolation.

Why SPF isn't enough and you still need DMARC

Irrespective of which failure mode you specify in your SPF record, receiving servers are unlikely to honor your requested policy. This is because SPF is limited in that:

  1. It does not require alignment between the domain in the From field and the Return-Path address it checks. They don't have to match from an SPF perspective.
  2. SPF does not provide reporting functionality, meaning the receiver does not send back reports to the sender containing email authentication results.
  3. SPF does not survive auto-forwarding and indirect mail-flows, which can lead to authentication issues.

Due to these limitations, DMARC (Domain-based Message Authentication, Reporting, and Conformance) was introduced as an additional email authentication standard. DMARC addresses the shortcomings of SPF and provides the following enhancements:

  1. DMARC focuses on the visible From header, which is seen by end-users.
  2. DMARC requires alignment between the domain used by SPF and the visible From address in the email.
  3. DMARC ignores the nuances of soft fail and hard fail in SPF configuration, treating them as SPF failures.
  4. DMARC provides reporting functionality, allowing email authentication results to be sent back to the owner of the From domain. This helps identify domain misuse and troubleshoot any misconfigurations with legitimate email senders.
  5. DMARC includes a policy that instructs receivers on how to handle emails that fail authentication, and receivers enforce this policy. In contrast, SPF alone does not have enforcement mechanisms.

DMARC has gained widespread adoption as an authentication requirement as it overcomes the shortcomings of SPF and DKIM, blocks exact email impersonation, and improves email deliverability.

email set up imageemail set up image
Email set up correctly? Find out free in under a minute

Domande frequenti: Guida alla configurazione dei protocolli email

Qual è la differenza tra SPF Hard Fail (-all) e Soft Fail (~all) e quale opzione dovrei utilizzare nel 2026?

Prima di DMARC, nei record SPF era spesso usato il meccanismo “-all” per applicare restrizioni rigorose alle policy dei mittenti. Tuttavia, le attuali raccomandazioni del settore per il 2026 privilegiano “~all” per bilanciare sicurezza e deliverability ed evitare il rifiuto non necessario di email legittime che falliscono SPF, ma superano DKIM e DMARC.

Il motivo è che “~all” in combinazione con DMARC (in p=reject) consente comunque di non recapitare email non autenticate quando SPF e DKIM falliscono, senza bloccare email legittime – migliorando così la deliverability complessiva.

Le specifiche DMARC (RFC 7489) affermano che un prefisso “-” nel meccanismo SPF del mittente – come “-all” – può comportare il rifiuto di un’email già nella fase iniziale, cioè prima che venga applicato DMARC. Utilizza “-all” solo per domini inattivi che non inviano mai email. DMARC non distingue tra Soft Fail e Hard Fail su SPF: considera entrambi semplicemente come un errore SPF.

Come funziona il DMARC-Alignment e qual è la differenza tra Strict e Relaxed Alignment?

DMARC richiede non solo che SPF o DKIM abbiano esito positivo, ma anche che almeno uno dei domini usati con SPF o DKIM corrisponda al dominio presente nell'intestazione From. Un corretto allineamento è fondamentale nel 2026 per la consegna delle email, perché i principali provider ora richiedono questa verifica.

Per SPF, l’allineamento significa che la verifica di MAIL FROM/Return-PATH è andata a buon fine e la parte dominio di MAIL FROM/Return-PATH coincide con il dominio dell’indirizzo From. In modalità Strict le due devono essere identiche; in modalità Relaxed vengono accettate anche le sottodomini se appartengono alla stessa organizational domain.

Esempio: se MAIL-FROM/RETURN-PATH è @ondmarc.com e il From-header è @knowledge.ondmarc.com, non sono allineati in modalità Strict, ma DMARC li considererebbe validi in modalità Relaxed.

Cosa sono i report aggregati e forensi di DMARC e qual è la differenza?

Un report aggregato DMARC contiene informazioni sullo stato di autenticazione dei messaggi inviati per conto di un dominio. Si tratta di un bounce report in XML che riepiloga quali email hanno superato o fallito SPF e DKIM. Permette ai possessori di dominio di avere una panoramica precisa delle fonti che inviano email a loro nome e cosa succede (policy del destinatario).

I destinatari usano il tag 'rua' del record DMARC per inviare i report. Puoi definire la frequenza usando il tag ri nel record DMARC (valore predefinito: 86400 secondi, ovvero 24h). I report forensi forniscono dettagli molto più precisi su ogni fallimento di autenticazione. I dati personali vengono rimossi, ma tutte le informazioni utili alla risoluzione dei problemi, come header SPF/DKIM e indirizzo mittente completo e oggetto, sono trasmesse.

L’indirizzo di ricezione dei report forensi DMARC si indica tramite il tag 'ruf'. Non tutti i sistemi supportano questi report. Red Sift OnDMARC è tra le poche soluzioni che può ricevere report forensi – grazie alla partnership con Yahoo.

Cosa sono le macro SPF e perché possono causare problemi di deliverability?

Una macro SPF è un meccanismo nei record SPF che consente di definire insiemi riutilizzabili di indirizzi IP. Le macro SPF offrono maggiore flessibilità e mantenibilità: puoi definire set complessi di IP in un unico meccanismo e referenziarli in vari record. Ad esempio, invece di elencare ogni IP autorizzato, puoi usare una macro come “%{i}”, che richiama l’IP in uscita dell’email. In questo modo puoi gestire facilmente grandi elenchi IP senza superare il limite di lookup SPF e rendere meno evidenti le autorizzazioni IP durante le interrogazioni DNS.

A seconda della struttura della macro nel record SPF, una mancata espansione della macro può causare errori SPF o un risultato neutro (?all). Se l’invio di email legittime dipende dalle macro SPF, queste ultime possono portare a maggiori fallimenti o a segnalare come sospetto il traffico verso sistemi che si basano su SPF.

Cos’è MTA-STS e come si attiva senza bloccare la ricezione degli email?

Mail Transfer Agent Strict Transport Security (MTA-STS) è uno standard per la cifratura dei messaggi tra due server di posta. Comunica ai server mittenti che le email devono essere recapitate solo tramite connessione sicura, tramite Transport Layer Security (TLS), proteggendo così dai tentativi di intercettazione da parte dei criminali informatici.

L’adozione di MTA-STS è cresciuta rapidamente e nel 2026 la sicurezza dei trasporti sarà considerata essenziale per la protezione della posta in transito. Per attivare MTA-STS su un dominio ricevente, occorre dichiarare il supporto tramite DNS e rendere disponibile un file di policy sul proprio sito.

MTA-STS va attivato con cautela per non causare blocchi accidentalmente. Si consiglia di iniziare con la modalità Test: in questo modo, grazie ai rapporti TLS, puoi identificare e risolvere eventuali errori prima di passare alla modalità strict. Questo approccio graduale sarà probabilmente lo standard per la protezione della posta in transito nel 2026.

Cos’è TLS-RPT e come si collega a MTA-STS?

SMTP TLS Reporting (TLS-RPT), secondo RFC8460, serve a segnalare problemi di connettività TLS dai server MTA mittenti. Proprio come per DMARC, anche qui vengono inviati report via email al titolare del dominio quando problemi TLS ostacolano la consegna. I report contengono le policy MTA-STS rilevate, statistiche di traffico, connessioni fallite e motivi di errore.

Con la funzione MTA-STS in Red Sift OnDMARC non dovrai preoccuparti delle complesse implementazioni. Basta aggiungere gli MTA-STS Smart Record forniti da OnDMARC al proprio DNS e Red Sift si occuperà dell’hosting del file di policy, la gestione del certificato SSL e l’invio automatico di segnalazioni di violazione via report TLS. Nel 2026, l’MTA-STS in hosting è sempre più uno standard previsto nelle moderne piattaforme DMARC, rendendo più semplice l’integrazione della cifratura nei trasporti.

Cos’è DANE e in cosa differisce da MTA-STS?

Secondo RFC 7671, DANE (DNS-based Authentication of Named Entities) è un nuovo standard Internet per la creazione di comunicazioni TLS tra client e server senza dipendere dalle autorità di certificazione (CA) tradizionali.

Nel modello attuale, qualsiasi CA può rilasciare un certificato per qualunque dominio. DANE adotta un altro approccio, sfruttando l’infrastruttura DNSSEC (Domain Name System Security Extensions) per associare in modo crittografico un nome di dominio a un certificato. DANE si basa sul protocollo DNSSEC esistente per garantire autenticità e integrità della ricezione.

DANE introduce inoltre un nuovo tipo di record DNS, TLSA, che segnala al client il supporto server a TLS. È raccomandato implementare sia MTA-STS sia DANE. DANE è d’obbligo per molti enti pubblici, in particolare in UE.

MTA-STS e DANE sono efficaci solo se anche il server mittente li supporta – molti implementano solo uno dei due. Attivare entrambi aumenta la sicurezza generale. Nel 2026 le organizzazioni adottano spesso MTA-STS prima, per massima compatibilità, e aggiungono DANE per livelli di sicurezza superiori quando richiesto.

A cosa serve la policy DMARC per le sottodomini (sp-tag) e come viene applicata?

La policy per le sottodomini permette agli amministratori di proteggere in modo differenziato diversi domini e sottodomini a seconda dello stadio di implementazione di DMARC. Ad esempio, se tutti i servizi di invio associati al dominio principale sono già protetti da SPF e DKIM, puoi impostare una policy DMARC p=reject sul dominio principale e p=none sulle sottodomini – o viceversa.

Se un servizio di invio non supporta DMARC (cioè non implementa SPF o DKIM) puoi assegnargli una sottodominio separata con una policy DMARC propria, senza compromettere la protezione dei domini restanti. Ciò consente di distribuire il traffico tra diverse sottodomini e proteggerle separatamente secondo le esigenze.