Configure DNS records to send emails in Odoo

SPAM labels overview

Sometimes, emails from Odoo are misclassified by the different email providers and end up in spam folders. At the moment, some settings are out of Odoo’s control, notably the way the different email providers classify Odoo’s emails according to their own restriction policy and/or limitations.

It is standard in Odoo that emails are received from "name of the author" <notifications@mycompany.odoo.com>. In other words this can be translated to: "name of the author" <{ICP.mail.from.filter}@{mail.catchall.domain}>. In this case ICP stands for ir.config.parameters, which are the System Parameters. Deliverability is greatly improved with the notifications configuration.

In order for servers to accept emails from Odoo on a more regular basis, one of the solutions is for customers to create rules within their own mailbox. A filter can be added to the email inbox so that when email is received from Odoo (notifications@mycompany.odoo.com) it is moved to the inbox. It is also possible to add the Odoo database domain onto a safe senders list or whitelist on the receiving domain.

If an Odoo email server appears on a blacklist, notify Odoo via a new help ticket and the support team will work to get the servers removed from the blacklist.

Should the Odoo database be using a custom domain for sending emails from Odoo there are three records that should be implemented on the custom domain’s DNS to ensure deliverability of email. This includes setting records for SPF, DKIM and DMARC. Ultimately though, it is up to the discretion of the final receiving mailbox.

Fii compatibil SPF

The Sender Policy Framework (SPF) protocol allows the owner of a domain name to specify which servers are allowed to send emails from that domain. When a server receives an incoming email, it checks whether the IP address of the sending server is on the list of allowed IPs according to the sender’s SPF record.

Notă

Verificarea SPF este efectuată pe domeniul menționat în câmpul Return-Path al emailului. În cazul unui email trimis de Odoo, acest domeniu corespunde valorii cheii mail.catchall.domain în parametrii de sistem ai bazei de date.

Politica SPF a unui domeniu este setată folosind un înregistrare TXT. Modul de creare sau modificare a unei înregistrări TXT depinde de furnizorul care găzduiește zona DNS a numelui de domeniu. Pentru ca verificarea să funcționeze corect, fiecare domeniu poate avea doar o înregistrare SPF.

If the domain name does not yet have a SPF record, create one using the following input: v=spf1 include:_spf.odoo.com ~all

If the domain name already has a SPF record, the record must be updated (and do not create a new one).

Example

Dacă înregistrarea TXT este v=spf1 include:_spf.google.com ~all, editați-o pentru a adăuga include:_spf.odoo.com: v=spf1 include:_spf.odoo.com include:_spf.google.com ~all

Verificați dacă înregistrarea SPF este validă cu un instrument gratuit ca MXToolbox SPF.

Activează DKIM

DomainKeys Identified Mail (DKIM) permite unui utilizator să autentifice emailuri cu o semnătură digitală.

Când trimiteți un email, serverul Odoo include o semnătură unică DKIM în antet. Serverul destinatarului decriptează această semnătură folosind înregistrarea DKIM în numele de domeniu al bazei de date. Dacă semnătura și cheia conținută în înregistrare se potrivesc, aceasta garantează că mesajul este autentic și nu a fost alterat în timpul transportului.

Pentru a activa DKIM, adăugați o înregistrare CNAME în zona DNS a numelui de domeniu:

odoo._domainkey IN CNAME odoo._domainkey.odoo.com.

Sfat

Dacă numele de domeniu este mycompany.com, asigurați-vă că creați un subdomeniu odoo._domainkey.mycompany.com al cărui nume canonical este odoo._domainkey.odoo.com..

Modul de creare sau modificare a unei înregistrări CNAME depinde de furnizorul care găzduiește zona DNS a numelui de domeniu. Furnizorii cei mai comuni sunt listați mai jos.

Verificați dacă înregistrarea DKIM este validă cu un instrument gratuit ca DKIM Core. Dacă este solicitat un selector, introduceți odoo.

Verificați politica DMARC

Înregistrarea Domain-based Message Authentication, Reporting, & Conformance (DMARC) este un protocol care unifică SPF și DKIM. Instrucțiunile conținute în DMARC înregistrarea numelui de domeniu spun serverului de destinație ce să facă cu un email care nu reușește SPF și/sau DKIM verificarea.

Example

DMARC: TXT record

v=DMARC1; p=none;

Sunt trei DMARC politici:

  • p=none

  • p=quarantine

  • p=reject

p=quarantine și p=reject instruiește serverul care primește un email să pună în carantină acel email sau să-l ignore dacă SPF și/sau DKIM verificarea eșuează.

Dacă numele de domeniu folosește DMARC și a definit una dintre aceste politici, numele de domeniu trebuie să fie SPF conform sau să activeze DKIM.

Atenționare

Yahoo sau AOL sunt exemple de furnizori de email cu o politică DMARC setată la p=reject. Odoo recomandă ferm să nu utilizați o adresă @yahoo.com sau @aol.com pentru utilizatorii bazei de date. Aceste email-uri nu vor ajunge niciodată la destinatar.

p=none este folosit de proprietarul de domeniu pentru a primi rapoarte despre entitățile care folosesc domeniul lor. Nu ar trebui să afecteze livrabilitatea dacă DMARC verificarea eșuează.

DMARC records are comprised of tags in the form of DNS records. These tags/parameters allow for reporting, such as RUA and RUF, along with more precise specification like PCT, P, SP ADKIM & ASPF. For best practice, the the DMARC policy should not start out being too restrictive.

The following chart displays available tags:

Nume eticheta

Scop

Exemplu

v

Protocol version

v=DMARC1

pct

Percentage of messages subjected to filtering

pct=20

ruf

Reporting URI for forensic reports

ruf=mailto:authfail@example.com

rua

Reporting URI of aggregate reports

rua=mailto:aggrep@example.com

p

Policy for organizational domain

p=quarantine

sp

Policy for subdomains of the OD

sp=reject

adkim

Alignment mode for DKIM

adkim=s

aspf

Alignment mode for SPF

aspf=r

Verificați DMARC înregistrarea unui nume de domeniu cu un instrument precum MXToolbox DMARC.

SPF, DKIM & DMARC documentație a furnizorilor comuni

To fully test the configuration, use the Mail-Tester tool, which gives a full overview of the content and configuration in one sent email. Mail-Tester can also be used to configure records for other, lesser-known providers.