Search code examples
emailspfdmarc

how mail server decide whether sender is a spammer by screening SPF


I tried to find the answer from google but all result is showing why SPF is important instead of explain the working mechanism and how mail server(gmail, microsoft, smartermail, etc) implement it, generally.

Below is the criteria in came out but could find the answer:

  1. SPF record exist, labeled sender & mail server domain aren't same, mail server domain/IP included
  2. SPF record exist, labeled sender & mail server domain aren't same, mail server domain/IP not included
  3. SPF record exist, labeled sender & mail server domain are same, mail server domain/IP not included
  4. SPF record not exist, labeled sender & mail server domain aren't same
  5. SPF record not exist, labeled sender & mail server domain are same

I would like to know, generally, which criteria will mark as junk mail by mail server.

Thank you.

Edit 1: Lets put the other factor apart, how mail server decide to increase/decrease the level of "points" by looking at SPF only?


Solution

  • SPF is only responsible for identifying sources of email, and has no opinion about content.

    You're asking how receiving email servers decide what to do with messages that fail SPF checks. That's a good question, because it's something that a domain owner should be concerned about, and historically this has been undefined (as others have pointed out), and so varied wildly. Fortunately there's now a mechanism whereby the domain owner can say what a receiving server should do with messages that fail SPF checks: DMARC.

    DMARC includes a p parameter that tells a receiver what to do with messages that fail checks. Its value can be none (do nothing, or whatever the receiver chooses), quarantine (put in spam or similar), or reject (bounce the message).

    DMARC can apply these same policies to DKIM, and it also provides additional validation of the alignment between the SMTP envelope sender and the From message header.

    If a domain lacks a DMARC record, you're back to guessing the outcome, and subject to the whims of receiving mail server admins' decisions.