> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://krystal-dev.crisp.help/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Improving mail deliverability with SPF, DKIM and DMARC

This article explains how to check and setup:

*   **Sender Policy Framework (SPF)** - SPF is a system whereby a special DNS record is created in your domain that identifies all of the servers that are authorised to send email for your domain. The idea being, that when a mail server receives an email that appears to have come from you, it checks for SPF records in your domain to see if the server that sent the mail message is actually authorised to do so. If it is, then your message gets delivered - if it isn't then your message is rejected as spam.
*   **DomainKeys Identified Mail (DKIM)** - DKIM is slightly different - it uses public/private key encryption techniques to attach a digital signature to your outgoing message headers using a secret private key. The receiving server will check the validity of the signature using a public key that is in your DNS . It's a bit like the digital security certificates that validate your online banking.
*   **Domain-based Message Authentication, Reporting, and Conformance (DMARC)** - DMARC adds a further DNS record that defines how your domain handles suspicious email. This enhances the capture of forged spam emails.

This guide only applies if you are using a domain using Krystal's mail servers. It is possible to add SPF, DKIM and DMARC records manually for other email providers - for example we have a guide on [configuring appropriate DNS entries for use with Google / GSuite](/article/vvpg4rqmtv-how-to-configure-mx-records-for-google-mail).

### SPF & DKIM

1.  SPF & DKIM records for a domain can be accessed via **Email Deliverability** in the **EMAIL** section of cPanel.
    
    ![](https://storage.crisp.chat/users/helpdesk/website/a3048607ec25c000/76938884-109a-43d6-b0a4-e0ecf8_qqb12z.png)
    
2.  Click **Manage** next to the domain you'd like to setup. **Repair** will restore the default records if that's all you need.
    
    ![](https://storage.crisp.chat/users/helpdesk/website/726e907c7b840400/b6c61dd8-c1d4-4a90-bd0a-c6376b_1sivft1.png)
    
3.  The top two sections show the suggested DKIM and SPF records. Go ahead and click **Install the suggested record** for each to setup the default records.
    
    ![](https://storage.crisp.chat/users/helpdesk/website/f05f70f37f082000/219d508d-89d8-4aea-b074-5c34d7_1kwvdxv.png)
    
4.  The final section shows the PTR (reverse DNS record) for the domain.
    
    ![](https://storage.crisp.chat/users/helpdesk/website/2621b05e1e4f2c00/935eb998-e707-43e9-8cd8-b9f8a0_l4op0x.png)
    

Should you need to remove or edit the DKIM & SPF records you can do so using the [cPanel DNS Zone Editor](/domains/managing-dns-using-c-panel-zone-editor).

### DMARC

cPanel includes the ability to add a DMARC record via the [cPanel DNS Zone Editor](/domains/managing-dns-using-c-panel-zone-editor).

1.  Open **Zone Editor** from the **DOMAINS** section of cPanel.
    
    ![](https://storage.crisp.chat/users/helpdesk/website/8437f5bfaade3800/7c143150-1d38-4127-b24b-ab2679_pq39ny.png)
    
2.  Click Manage next to the domain for which you'd like to add a DMARC record.
    
    ![](https://storage.crisp.chat/users/helpdesk/website/1ff929a8a5c86e00/78dfc822-ac67-4ada-9b00-5fa631_mzogkq.png)
    
3.  Check for any existing DMARC records listed - you can **Edit** the record if there is.  
    Click the **+ Add Record** drop-down and select **Add DMARC Record**.
    
    ![](https://storage.crisp.chat/users/helpdesk/website/8faea8cac50db800/473041b6-05db-4cbe-bf33-3f0e20_hvtegy.png)
    
4.  Click **Optional Parameters** to show all the DMARC options.
    
    ![](https://files.helpdocs.io/8nzbvyta9f/articles/fqipxada8x/1650976025634/improving-email-deliverability-image-8.png)
    
    cPanel defaults to adding a v1 DMARC record (v=DMARC1).  
    **Policy** (p) - defines how email received from your domain is handled.  
    **Subdomain Policy** (sp) - defines how your email received from your sub-domains is handled.  
    **DKIM mode** (adkim) - defines whether email received from your domain that fails your DKIM policy should be delivered (Relaxed) or rejected (Strict).  
    **SPF mode** (aspf) - defines whether email received from your domain that fails your SPF policy should be delivered (Relaxed) or rejected (Strict).  
    **Percentage** (pct) - defines the percentage of emails received from your domain which should have your DMARC policy applied.  
    **Generate Failure Reports When** (fo) - you can choose to receive a report either only when all checks fail, or when any check fails.  
    **Report Format** (rf) - choose between AFRF and IODEF format for your reports.  
    **Report Interval** (ri) - how often you'd like to receive reports (in seconds - 86400 = 24 hours).  
    **Send Aggregate Mail Reports To** (rua) - aggregate reports contain XML machine readable details about what emails were received and their check results.  
    **Send Failure Reports To** (ruf) - these are also called forensic reports - and contain the full email messages that failed DMARC authenticator.  
    Click the **Raw** tab to view the actual record that'll be added to DNS when you click the **Add Record** button.
    
    ![](https://files.helpdocs.io/8nzbvyta9f/articles/fqipxada8x/1650976031335/improving-email-deliverability-image-9.png)
    
    Once you've added a DMARC record you can simply **Edit** the record in future to make changes.
    
    ### Implementing a DMARC policy
    
    In simple terms, you first need to ensure you have appropriate SPF and DKIM records in place for all sending sources for your domain/sub-domains.
    
    || It's important to understand that your DMARC policy is applied by remote mail servers receiving emails purporting to be from your domain.
    
    Start by implementing a None DMARC policy - with all other options set to their default. This will mean you start to receive reports - allowing you check whether all your valid email is being received correctly.  
    Then change your policy to Quarantine, with a low Percentage (maybe 20%) of emails. Gradually increase the percentage of emails checked as you are happy that only spam/spoofed emails are being quarantined.  
    Finally, once you're totally happy that all genuine emails originating from your domain are being correctly authenticated by the remote mail servers you can switch to a Reject policy.  
    Much more detail about DMARC and it's configuration options can be found at [dmarc.org - external link opens in a new window](https://dmarc.org/overview/).

* * *

* * *