Checking Phishing Mail by SPF, DKIM, and DMARC

Pradeep Gupta
2 min readJun 27, 2023
DKIM, SPF and DMARC

What are SPF, DKIM, and DMARC?

DMARC, DKIM, and SPF are three email authentication methods. Together, they help prevent spammers, phishers, and other unauthorized parties from sending emails fraudulent or malicious emails on behalf of a domain* they do not own.

DKIM and SPF can be compared to a business license or a doctor’s medical degree displayed on the wall of an office — they help demonstrate legitimacy.

Meanwhile, DMARC tells mail servers what to do when DKIM or SPF fail, whether that is marking the failing emails as “spam,” delivering the emails anyway, or dropping the emails altogether.

  • SPF (Sender Policy Framework) allows you to specify which servers are authorized to send email on behalf of your domain. When an email arrives at a recipient’s inbox, the recipient’s mail server will check the SPF record for the sender’s domain to see if it is authorized to send email from that domain. If the SPF record does not allow the sender’s server to send email from that domain, the email will be rejected.
v=spf1 include:8112310.spf10.hubspotemail.net -all
v=spf1 include:8112310.spf10.hubspotemail.net ~all
  • DKIM (DomainKeys Identified Mail) allows you to sign your emails with a cryptographic signature that can be verified by the recipient’s mail server. This helps to ensure that the email has not been tampered with since it was sent.
  • DMARC (Domain-based Message Authentication, Reporting and Conformance) builds on SPF and DKIM by providing a way for domain owners to specify what should happen to emails that fail SPF or DKIM validation. For example, you can configure DMARC to reject all emails that fail SPF or DKIM validation, or you can configure it to quarantine them instead.
v=DMARC1; p=none; sp=none; rua=mailto:dmarc@abc.org

By using SPF, DKIM, and DMARC together, you can help to protect your organization from email spoofing and phishing attacks.

Comparison

--

--