Konfigurasi record DNS untuk mengirim email di Odoo

This documentation presents three complementary authentication protocols (SPF, DKIM, and DMARC) used to prove the legitimacy of an email sender. Not complying with these protocols will greatly reduce chances of your emails to reach their destination.

Odoo Online and Odoo.sh databases using the default Odoo subdomain address (e.g., @company-name.odoo.com) are pre-configured to send authenticated emails compliant with the SPF, DKIM, and DMARC protocols.

If choosing to use a custom domain instead, configuring SPF and DKIM records correctly is essential to prevent emails from being quarantined as spam or not being delivered to recipients.

If using the default Odoo email server to send emails from a custom domain, the SPF and DKIM records must be configured as presented below. If using an outgoing email server, it is required to use the SPF and DKIM records specific to that email service and a custom domain.

Catatan

Email service providers apply different rules to incoming emails. An email may be classified as spam even if it passes the SPF and DKIM checks.

SPF (Sender Policy Framework)

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.

In Odoo, the SPF test is performed on the bounce address defined under the Alias Domain field found under the database's General Settings. If using a custom domain as Alias Domain, it is necessary to configure it to be SPF-compliant.

The SPF policy of a domain is set using a TXT record. The way to create or modify this record depends on the provider hosting the DNS zone of the domain name.

If the domain name does not yet have an SPF record, create one using the following input:

v=spf1 include:_spf.odoo.com ~all

If the domain name already has an SPF record, the record must be updated. Do not create a new one, as a domain must have only one SPF record.

Example

If the TXT record is v=spf1 include:_spf.google.com ~all, edit it to add include:_spf.odoo.com: v=spf1 include:_spf.odoo.com include:_spf.google.com ~all

Check the SPF record using a tool like MXToolbox SPF Record Check. The process to create or modify an SPF record depends on the provider hosting the DNS zone of the domain name. The most common providers and their documentation are listed below.

DKIM (DomainKeys Identified Mail)

The DomainKeys Identified Mail (DKIM) allows a user to authenticate emails with a digital signature.

Saat mengirim email, server email Odoo menyertakan tanda tangan DKIM unik di header. Server penerima mendekripsi tanda tangan ini menggunakan catatan DKIM di nama domain database. Jika tanda tangan dan kunci yang terdapat dalam catatan cocok, ini membuktikan pesan tersebut autentik dan tidak diubah selama pengiriman.

Enabling DKIM is required when sending emails from a custom domain using the Odoo email server.

Tambahkan catatan CNAME untuk domain

Untuk mengaktifkan DKIM, tambahkan catatan canonical name (CNAME) ke zona domain name system (DNS) dari nama domain:

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

Jika nama domain adalah company-name.com, pastikan untuk membuat catatan CNAME di mana catatan CNAME (kunci/nama) adalah odoo._domainkey.company-name.com, dan canonical name (nilai/konten) adalah odoo._domainkey.odoo.com.. Sebagai contoh, perhatikan perbedaan antara setiap kunci/nilai dalam huruf miring:

Contoh catatan CNAME

Kunci

odoo._domainkey

Value

odoo._domainkey.odoo.com. 

ATAU

odoo._domainkey.dbname.odoo.com.

... di mana dbname adalah nama database Odoo.

Di sebagian besar platform DNS, penyedia DNS menambahkan domain kustom (misalnya, company-name.com) secara default. Dalam hal ini, kunci terlihat berbeda sementara nilai tetap sama:

Contoh catatan CNAME dengan domain kustom

Kunci

odoo._domainkey.company-name.com 

... di mana company-name.com adalah domain kustom.

Value

odoo._domainkey.odoo.com. 

ATAU

odoo._domainkey.dbname.odoo.com.

... di mana dbname adalah nama database Odoo.

Catatan

Jika penyedia DNS tidak menambahkan domain kustom secara default, pastikan untuk menyertakannya.

Tambahkan catatan CNAME untuk subdomain

Jika ada subdomain (misalnya, marketing di marketing.company-name.com), tambahkan catatan CNAME untuk menyertakannya agar tetap patuh:

Contoh record CNAME dengan subdomain

Kunci

odoo._domainkey.marketing 

... di mana marketing adalah subdomain.

ATAU

odoo._domainkey.marketing.company-name.com 

... di mana company-name.com adalah domain kustom.

Value

odoo._domainkey.odoo.com. 

ATAU

odoo._domainkey.dbname.odoo.com.

... di mana dbname adalah nama database Odoo.

Lihat dokumentasi penyedia DNS

The way to create or modify a CNAME record depends on the provider hosting the DNS zone of the domain name. The most common providers and their documentation are listed below.

Periksa apakah record DKIM valid menggunakan alat seperti MXToolbox DKIM Record Lookup. Masukkan example.com:odoo di alat lookup DKIM, yang menentukan bahwa selector yang diuji adalah odoo untuk domain kustom example.com.

DMARC (Domain-based Message Authentication, Reporting and Conformance)

The DMARC record is a protocol that unifies SPF and DKIM. The instructions contained in the DMARC record of a domain name tell the destination server what to do with an incoming email that fails the SPF and/or DKIM check.

Catatan

The aim of this documentation is to help understand the impact DMARC has on the deliverability of emails, rather than give precise instructions for creating a DMARC record. Refer to a resource like DMARC.org to set the DMARC record.

Terdapat tiga kebijakan DMARC:

  • p=none

  • p=quarantine

  • p=reject

p=quarantine dan p=reject menginstruksikan server yang menerima email untuk mengkarantina email tersebut atau mengabaikannya jika pemeriksaan SPF atau DKIM gagal.

Catatan

Agar DMARC lulus, pemeriksaan DKIM atau SPF harus lulus dan domain harus selaras. Jika jenis hosting adalah Odoo Online, konfigurasi DKIM pada domain pengirim diperlukan untuk lulus DMARC.

Lulus DMARC umumnya berarti email akan berhasil terkirim. Namun, penting untuk dicatat bahwa faktor lain seperti filter spam masih dapat menolak atau mengkarantina pesan.

p=none digunakan untuk pemilik domain menerima laporan tentang entitas yang menggunakan domain mereka. Ini seharusnya tidak memengaruhi kemampuan pengiriman.

Example

_dmarc IN TXT “v=DMARC1; p=none; rua=mailto:postmaster@example.com” berarti laporan agregat DMARC akan dikirim ke postmaster@example.com.

Dokumentasi SPF, DKIM dan DMARC dari penyedia umum

Untuk menguji konfigurasi sepenuhnya, gunakan alat Mail-Tester, yang memberikan gambaran lengkap tentang konten dan konfigurasi dalam satu email yang dikirim. Mail-Tester juga dapat digunakan untuk mengonfigurasi catatan untuk penyedia lain yang kurang dikenal.