E-mail security and standards
Updated on
E-mail security and delivery are mainly handled by DNS rules specific to your domain. These rules not only ensure that e-mail is received properly, they also protect against spam and identity spoofing.
MX: E-mail receiving server
For your domain to receive e-mail, an MX entry must be present in the domain’s DNS zone. The MX record corresponds to the SMTP server that receives e-mail and always points to a domain name (canonical name) and not an IP address.
Example:
If your domain is monsite.tld and your e-mail is hosted with LRob on the server ds.lrob.net, here is an example record:
mail A 138.201.17.216
MX 0 mail.monsite.tld
This MX record ensures that all e-mail addressed to monsite.tld is sent to the server mail.monsite.tld.
E-mail security
Although it is difficult to make e-mail security standards universal, several standards are now widely adopted to:
- Reduce the amount of spam received
- Limit identity spoofing
Here are the main standards you can implement.
FQDN, HELO, rDNS
The HELO is the introduction message sent by an SMTP server when sending an e-mail. To be considered legitimate, the HELO must meet these criteria:
- It must be a valid FQDN (a full domain name or subdomain) pointing to the SMTP server’s IP address.
- The FQDN must match the reverse DNS (rDNS) of the SMTP server’s IP address.
- The rDNS must not be in the default form (e.g. IPReversed.provider.tld), as this often indicates an insecure server or a botnet sending spam.
Our LRob servers are configured to reject e-mail with an incorrect HELO, because it is a basic standard that every sender must meet. If you receive e-mail blocked for this reason, we can, as a last resort, whitelist the sender, but this disables any check of the sending server’s authenticity, which is strongly discouraged.
SPF (Sender Policy Framework)
SPF is a security mechanism that defines which servers are allowed to send e-mail for a given domain. This is done through a TXT entry in the domain’s DNS zone. SPF helps prevent identity spoofing by ensuring that only authorized servers can send e-mail on behalf of your domain.
How SPF works
When a receiving server gets an e-mail from your domain, it checks for an SPF rule in the sending domain’s DNS zone:
- If the DNS zone contains a valid SPF rule and it is met, the e-mail is accepted.
- If there is no SPF rule, the e-mail may get through, but is more likely to be marked as spam.
- If the SPF rule is not met, the e-mail may be rejected (depending on the -all parameter) or marked as spam (~all).
LRob’s SPF rule
The default SPF rule for domains hosted with LRob is as follows:
v=spf1 +mx include:_spf.lrob.net -all
Common SPF errors
- Creating several SPF entries: There must be only one SPF rule per domain. If you have several, receiving servers may read them erratically and produce errors.
- Using the wrong SMTP server: You must use an SMTP server authorized in your SPF rule. If you use another server, your e-mail will most likely be rejected.
DKIM (DomainKeys Identified Mail)
DKIM is a standard that digitally signs e-mail sent from your domain. This signature is checked by receiving servers using a public key published in your DNS zone, which guarantees the integrity and authenticity of the message.
Enable DKIM via Plesk
- Go to your Plesk control panel.
- Go to the Mail section, then Mail Settings.
- Tick the box “Use DKIM spam protection system to sign outgoing email messages”.
- Click OK.
This will automatically enable DKIM signing for your e-mail as well as the matching DNS entry.
DMARC (Domain-based Message Authentication)
DMARC is a standard that complements SPF and DKIM and lets you define a policy for when these two standards are not met. DMARC lets you choose the action to take (reject, mark as spam, etc.) if an e-mail fails the SPF or DKIM checks.
Example of a DMARC rule
Here is the default DMARC rule in LRob’s DNS zone:
"v=DMARC1; p=reject; sp=reject; aspf=s; rua=mailto:dmarcreport@lrob.fr; ruf=mailto:dmarcreport@lrob.fr; rf=afrf; pct=100; ri=172800
This rule:
- Rejects e-mail that does not comply with the SPF policy.
- Allows some tolerance if there is a problem with DKIM.
- Prevents e-mail from being sent from unauthorized subdomains.
- Sends rejection reports to the address dmarcreport@lrob.fr.
Blacklists
Blacklists are public lists of the IP addresses associated with sending spam. If the IP of a sending SMTP server is listed on one of these lists, its e-mail is likely to be rejected by receiving servers.