SPF Check Logic

The logic of the SPF check is described in more detail.

When an email is received on a destination server, the IP address of the sending server is compared with the records stored in the TXT record of the domain of the sending server. If the IP address of the sending server is not included in the SPF record, an error is returned. Depending on the severity, the check of the SPF record returns either a hardfail or a softfail.

You can decide which measures shall be taken for each type of fail (see Activating the SPF Check). If no errors occur, the email is delivered as usual.

Note:

The following explanations are based on the assumption that both the sender details from the envelope (MAIL FROM) and the sender details from the header (From) are being checked. If only one of these specifications is to be checked, a single check takes place and its fail type is decisive.

The following logic is considered when checking the TXT record:

  1. In the first step, the envelope (MAIL FROM) and the header (From) are checked simultaneously. If one of the checks fails, the type of its fail is considered in the next step. If both checks fail, the most serious type of fail is considered in the next step. There are three possible cases.
    Table 1. Case 1 - Both SPF checks end with a softfail

    If both the SPF check for the envelope and the SPF check for the header end with a softfail, a softfail is considered in the next step.

    Part of the email

    Configuration

    Type of fail

    Envelope (MAIL FROM)

    ~all

    Softfail

    Header (From)

    ~all

    Softfail

    Table 2. Case 2 - Both SPF checks end with a hardfail

    If both the SPF check for the envelope and the SPF check for the header end with a hardfail, a hardfail is considered in the next step.

    Part of the email

    Configuration

    Type of fail

    Envelope (MAIL FROM)

    -all

    Hardfail

    Header (From)

    -all

    Hardfail

    Table 3. Case 3 - The SPF checks end with different fails

    If the SPF checks for the envelope and the header end with different fails, a hardfail is considered in the next step.

    Part of the email

    Configuration

    Type of fail

    Envelope (MAIL FROM)

    -all

    Hardfail

    Header (From)

    ~all

    Softfail

  2. The second step is to check which measures you have set for a hardfail or a softfail. These are the measures which will be applied.