|
1 | | -======================== |
2 | | -Sending emails with Odoo |
3 | | -======================== |
| 1 | +======================= |
| 2 | +Send an email with Odoo |
| 3 | +======================= |
4 | 4 |
|
5 | | -Using your email domain in Odoo |
6 | | -=============================== |
| 5 | +Use an email domain in Odoo |
| 6 | +=========================== |
7 | 7 |
|
8 | 8 | Documents in Odoo (a CRM opportunity, a sales order, an invoice ...) have a discussion thread, |
9 | 9 | called *chatter*. |
10 | 10 |
|
11 | | -When you post a message in the chatter, this message is sent by email to the followers of the |
12 | | -document. If a follower replies to the message, the reply updates the chatter, and Odoo relays the |
13 | | -reply to the followers. |
| 11 | +When a database user posts a message in the chatter, this message is sent by email to the followers |
| 12 | +of the document. If a follower replies to the message, the reply updates the chatter, and Odoo |
| 13 | +relays the reply to the followers. |
14 | 14 |
|
15 | | -Emails from your users to partners (customers, vendors) are sent from the email address of your |
16 | | -users. Similarly, emails from partners to users are sent from the email address of the partners. |
17 | | -This allows you to recognize at a glance who sent an email relayed by Odoo. |
| 15 | +Emails from the database users to partners (customers or vendors) are sent from the email addresses |
| 16 | +of the database users. Similarly, emails from partners to users are sent from the email addresses |
| 17 | +of the partners. That way, the database users can recognize who sent an email relayed by Odoo. |
18 | 18 |
|
19 | | -If your database is hosted on our cloud (Odoo Online or Odoo.sh), it is not necessary to add an |
20 | | -outgoing email server to send emails from your custom domain. You can enjoy this feature by using |
21 | | -the default Odoo email server. |
| 19 | +If the Odoo database is hosted on the cloud (Odoo Online or Odoo.sh), it is not necessary to add an |
| 20 | +outgoing email server to send emails from a custom domain. |
22 | 21 |
|
23 | 22 | .. important:: |
24 | 23 | The Odoo server is subject to a daily email limit to prevent abuse. The default limit is 200 |
25 | | - emails sent per day for databases with an Enterprise subscription. This limit can be increased |
26 | | - under certain conditions. See our :doc:`FAQ <faq>` or contact support for more |
| 24 | + emails sent per day for databases with an **Enterprise** subscription. This limit can be |
| 25 | + increased under certain conditions. See the :doc:`FAQ <faq>` or contact support for more |
27 | 26 | information. |
28 | 27 |
|
29 | | -However, it is recommended that you configure your domain name to ensure that emails from your |
30 | | -users reach your partners, rather than being considered spam. |
| 28 | +To ensure that emails from the database users reach the partners, instead of being considered spam, |
| 29 | +Odoo recommends configuring the domain name. |
31 | 30 |
|
32 | | -For the same reason, we recommend that you always give your users an email address from a domain |
33 | | -you manage, rather than a generic email address (gmail.com, outlook.com, etc.). |
| 31 | +For the same reason, Odoo also recommends giving each database user an email address from the |
| 32 | +configured domain, rather than a generic email address domain (gmail.com, outlook.com, etc.). |
34 | 33 |
|
35 | 34 | .. _email_communication/spf_compliant: |
36 | 35 |
|
37 | 36 | Be SPF compliant |
38 | 37 | ================ |
39 | 38 |
|
40 | 39 | The Sender Policy Framework (SPF) protocol allows the owner of a domain name to specify which |
41 | | -servers are allowed to send email from that domain. When a server receives an incoming email, |
42 | | -it checks whether the IP address of the sending server is on the list of allowed IPs according |
43 | | -to the SPF record of the sender. |
| 40 | +servers are allowed to send emails from that domain. When a server receives an incoming email, |
| 41 | +it checks if the IP address of the sending server is on the list of allowed IPs according to the |
| 42 | +sender's :abbr:`SPF (Sender Policy Framework)` record. |
44 | 43 |
|
45 | 44 | .. note:: |
46 | | - The SPF verification is performed on the domain mentioned in the Return-Path field of the email. |
47 | | - In the case of an email sent by Odoo, this domain corresponds to the value of the |
48 | | - `mail.catchall.domain` key in the database system parameters. |
| 45 | + The :abbr:`SPF (Sender Policy Framework)` verification is performed on the domain mentioned in |
| 46 | + the `Return-Path` field of the email. In the case of an email sent by Odoo, this domain |
| 47 | + corresponds to the value of the `mail.catchall.domain` key in the database system parameters. |
49 | 48 |
|
50 | 49 | See the :ref:`documentation on incoming emails <email_communication/inbound_messages>`. |
51 | 50 |
|
52 | | -The SPF policy of a domain is set using a TXT record. How to create or modify a TXT record depends |
53 | | -on the provider hosting the DNS zone of your domain name. In order for the verification to work |
54 | | -properly, each domain can only have one SPF record. |
| 51 | +The :abbr:`SPF (Sender Policy Framework)` policy of a domain is set using a TXT record. The way to |
| 52 | +create or modify a TXT record depends on the provider hosting the :abbr:`DNS (Domain Name System)` |
| 53 | +zone of the domain name. In order for the verification to work properly, each domain can only have |
| 54 | +one :abbr:`SPF (Sender Policy Framework)` record. |
55 | 55 |
|
56 | | -If your domain name does not yet have an SPF record, the content of the record to create is as |
57 | | -follows: |
| 56 | +If the domain name does not yet have an :abbr:`SPF (Sender Policy Framework)` record, the content |
| 57 | +of the record to create it is as follows: |
58 | 58 |
|
59 | | -``v=spf1 include:_spf.odoo.com ~all`` |
| 59 | +`v=spf1 include:_spf.odoo.com ~all` |
60 | 60 |
|
61 | | -If your domain name already has an SPF record, you need to update this record (and do not create a |
62 | | -new one). |
| 61 | +If the domain name already has an :abbr:`SPF (Sender Policy Framework)` record, the record must be |
| 62 | +updated (and do not create a new one). |
63 | 63 |
|
64 | 64 | .. example:: |
65 | 65 |
|
66 | | - If your TXT record is `v=spf1 include:_spf.google.com ~all`, you need to edit it to add |
| 66 | + If the TXT record is `v=spf1 include:_spf.google.com ~all`, edit it to add |
67 | 67 | `include:_spf.odoo.com`: `v=spf1 include:_spf.odoo.com include:_spf.google.com ~all` |
68 | 68 |
|
69 | | -You can check if your SPF record is valid with a free tool like |
| 69 | +Check if the :abbr:`SPF (Sender Policy Framework)` record is valid with a free tool like |
70 | 70 | `MXToolbox SPF <https://mxtoolbox.com/spf.aspx>`_. |
71 | 71 |
|
72 | 72 | .. _email_communication/DKIM_compliant: |
73 | 73 |
|
74 | 74 | Enable DKIM |
75 | 75 | =========== |
76 | 76 |
|
77 | | -The DomainKeys Identified Mail (DKIM) allows you to authenticate your emails with a digital signature. |
| 77 | +The DomainKeys Identified Mail (DKIM) allows a user to authenticate emails with a digital |
| 78 | +signature. |
78 | 79 |
|
79 | | -When sending an email, the Odoo server includes a unique DKIM signature in the headers. The |
80 | | -recipient's server decrypts this signature using the DKIM record in your domain name. If the |
81 | | -signature and the key contained in the record match, this guarantees that your message is authentic |
82 | | -and has not been altered during transport. |
| 80 | +When sending an email, the Odoo server includes a unique :abbr:`DKIM (DomainKeys Identified Mail)` |
| 81 | +signature in the headers. The recipient's server decrypts this signature using the |
| 82 | +:abbr:`DKIM (DomainKeys Identified Mail)` record in the database's domain name. If the signature |
| 83 | +and the key contained in the record match, this guarantees that the message is authentic and has |
| 84 | +not been altered during transport. |
83 | 85 |
|
84 | | -To enable DKIM, you must add a CNAME record to the DNS zone of your domain name: |
| 86 | +To enable :abbr:`DKIM (DomainKeys Identified Mail)`, add a :abbr:`CNAME (Canonical Name)` record to |
| 87 | +the :abbr:`DNS (Domain Name System)` zone of the domain name: |
85 | 88 |
|
86 | | -``odoo._domainkey IN CNAME odoo._domainkey.odoo.com.`` |
| 89 | +`odoo._domainkey IN CNAME odoo._domainkey.odoo.com.` |
87 | 90 |
|
88 | 91 | .. tip:: |
89 | | - If your domain name is `mycompany.com`, you need to create a subdomain |
| 92 | + If the domain name is `mycompany.com`, make sure to create a subdomain |
90 | 93 | `odoo._domainkey.mycompany.com` whose canonical name is `odoo._domainkey.odoo.com.`. |
91 | 94 |
|
92 | | -How to create or modify a CNAME record depends on the provider hosting the DNS zone of your domain |
93 | | -name. The most common providers are list below. |
| 95 | +The way to create or modify a :abbr:`CNAME (Canonical Name)` record depends on the provider hosting |
| 96 | +the :abbr:`DNS (Domain Name System)` zone of the domain name. The most common providers are |
| 97 | +:ref:`listed below <email_communication/SPFDKIM_common_providers>`. |
94 | 98 |
|
95 | | -You can check if your DKIM record is valid with a free tool like |
| 99 | +Check if the :abbr:`DKIM (DomainKeys Identified Mail)` record is valid with a free tool like |
96 | 100 | `DKIM Core <https://dkimcore.org/tools/>`_. If a selector is asked, enter `odoo`. |
97 | 101 |
|
98 | | -Check your DMARC policy |
99 | | -======================= |
| 102 | +Check the DMARC policy |
| 103 | +====================== |
| 104 | + |
| 105 | +The Domain-based Message Authentication, Reporting, & Conformance (DMARC) record is a protocol that |
| 106 | +unifies :abbr:`SPF (Sender Policy Framework)` and :abbr:`DKIM (DomainKeys Identified Mail)`. The |
| 107 | +instructions contained in the :abbr:`DMARC (Domain-based Message Authentication, Reporting, & |
| 108 | +Conformance)` record of a domain name tell the destination server what to do with an incoming email |
| 109 | +that fails the :abbr:`SPF (Sender Policy Framework)` and/or :abbr:`DKIM (DomainKeys |
| 110 | +Identified Mail)` check. |
100 | 111 |
|
101 | | -The Domain-based Message Authentication, Reporting & Conformance (DMARC) is a protocol that unifies SPF |
102 | | -and DKIM. The instructions contained in the DMARC record of a domain name tell the destination |
103 | | -server what to do with an incoming email that fails the SPF and/or DKIM check. |
| 112 | +There are three :abbr:`DMARC (Domain-based Message Authentication, Reporting, & Conformance)` |
| 113 | +policies: |
104 | 114 |
|
105 | | -There are three DMARC policies: |
106 | | -- ``p=none`` |
107 | | -- ``p=quarantine`` |
108 | | -- ``p=reject`` |
| 115 | +- `p=none` |
| 116 | +- `p=quarantine` |
| 117 | +- `p=reject` |
109 | 118 |
|
110 | | -``p=quarantine`` and ``p=reject`` instruct the server that receives an email to quarantine that |
111 | | -email or ignore it if the SPF and/or DKIM check fails. |
| 119 | +`p=quarantine` and `p=reject` instruct the server that receives an email to quarantine that email |
| 120 | +or ignore it if the :abbr:`SPF (Sender Policy Framework)` and/or :abbr:`DKIM (DomainKeys Identified |
| 121 | +Mail)` check fails. |
112 | 122 |
|
113 | | -If your domain name uses DMARC and has defined one of these policies, it is therefore imperative |
114 | | -to be SPF compliant or to enable DKIM. |
| 123 | +If the domain name uses :abbr:`DMARC (Domain-based Message Authentication, Reporting, & |
| 124 | +Conformance)` and has defined one of these policies, the domain must be :abbr:`SPF (Sender Policy |
| 125 | +Framework)` compliant or enable :abbr:`DKIM (DomainKeys Identified Mail)`. |
115 | 126 |
|
116 | 127 | .. danger:: |
117 | | - Yahoo or AOL are examples of email providers with a DMARC policy set to ``p=reject``. We |
118 | | - strongly advise against using an *@yahoo.com* or *@aol.com* address for your users. These emails |
119 | | - will never reach their recipient. |
| 128 | + Yahoo or AOL are examples of email providers with a :abbr:`DMARC (Domain-based Message |
| 129 | + Authentication, Reporting, & Conformance)` policy set to `p=reject`. Odoo strongly advises |
| 130 | + against using an *@yahoo.com* or *@aol.com* address for the database users. These emails will |
| 131 | + never reach their recipient. |
120 | 132 |
|
121 | | -``p=none`` is used for the domain owner to receive reports about entities using their domain. It |
122 | | -should not impact the deliverability if the DMARC check fails. |
| 133 | +`p=none` is used for the domain owner to receive reports about entities using their domain. It |
| 134 | +should not impact the deliverability if the :abbr:`DMARC (Domain-based Message Authentication, |
| 135 | +Reporting, & Conformance)` check fails. |
123 | 136 |
|
124 | | -You can check the DMARC record of a domain name with a tool like |
125 | | -`MXToolbox DMARC <https://mxtoolbox.com/DMARC.aspx>`_. |
| 137 | +Check the :abbr:`DMARC (Domain-based Message Authentication, Reporting, & Conformance)` record of a |
| 138 | +domain name with a tool like `MXToolbox DMARC <https://mxtoolbox.com/DMARC.aspx>`_. |
126 | 139 |
|
127 | | -If one of your partners, customer or vendor, uses DMARC and has defined one of these policies, the |
128 | | -Odoo server cannot relay emails from this partner to your users. |
| 140 | +If a partner, customer, or vendor, uses :abbr:`DMARC (Domain-based Message Authentication, |
| 141 | +Reporting, & Conformance)` and has defined one of these policies, the Odoo server cannot relay |
| 142 | +emails from this partner to the database users. |
129 | 143 |
|
130 | | -You need to :ref:`handle user notifications in Odoo <discuss_app/notification_preferences>`, or replace the |
131 | | -email address of the partner with a default email address. |
| 144 | +To solve this issue, :ref:`handle user notifications in Odoo |
| 145 | +<discuss_app/notification_preferences>`, or replace the email address of the partner with a default |
| 146 | +email address. |
132 | 147 |
|
133 | 148 | .. _email_communication/SPFDKIM_common_providers: |
134 | 149 |
|
135 | | -SPF, DKIM & DMARC documentation of common providers |
136 | | -=================================================== |
| 150 | +SPF, DKIM, & DMARC documentation of common providers |
| 151 | +==================================================== |
137 | 152 |
|
138 | 153 | - `OVH DNS <https://docs.ovh.com/us/en/domains/web_hosting_how_to_edit_my_dns_zone/>`_ |
139 | 154 | - `OVH SPF <https://docs.ovh.com/us/en/domains/web_hosting_the_spf_record/>`_ |
140 | 155 | - `GoDaddy TXT record <https://www.godaddy.com/help/add-a-txt-record-19232>`_ |
141 | 156 | - `GoDaddy SPF <https://www.godaddy.com/help/add-an-spf-record-19218>`_ |
142 | 157 | - `GoDaddy DKIM <https://www.godaddy.com/help/add-a-cname-record-19236>`_ |
143 | | -- `NameCheap <https://www.namecheap.com/support/knowledgebase/article.aspx/317/2237/how-do-i-add-txtspfdkimdmarc-records-for-my-domain/>`_ |
| 158 | +- `NameCheap <https://www.namecheap.com/support/knowledgebase/article.aspx/317/2237/how-do-i-add- |
| 159 | + txtspfdkimdmarc-records-for-my-domain/>`_ |
144 | 160 | - `CloudFlare DNS <https://support.cloudflare.com/hc/en-us/articles/360019093151>`_ |
145 | 161 | - `Google Domains <https://support.google.com/domains/answer/3290350?hl=en>`_ |
146 | 162 | - `Azure DNS <https://docs.microsoft.com/en-us/azure/dns/dns-getstarted-portal>`_ |
147 | 163 |
|
148 | | -To fully test your configuration, the tool `Mail-Tester <https://www.mail-tester.com/>`_ will give |
149 | | -you a full overview of the content and configuration you have in one email sent! Mail-Tester can |
150 | | -also be used for other lesser known providers. |
| 164 | +To fully test the configuration, use the `Mail-Tester <https://www.mail-tester.com/>`_ tool, which |
| 165 | +gives a full overview of the content and configuration in one sent email. Mail-Tester can also be |
| 166 | +used for other, lesser-known providers. |
151 | 167 |
|
152 | 168 | Use a default email address |
153 | 169 | =========================== |
154 | 170 |
|
155 | | -To force the email address from which emails are sent, you need to create the following key in |
156 | | -the System Parameters of the database: |
| 171 | +Access the :guilabel:`System Parameters` by activating :ref:`developer mode <developer-mode>` and |
| 172 | +going to :menuselection:`Settings --> Technical --> Parameters --> System Parameters` menu. |
| 173 | + |
| 174 | +To force the email address from which emails are sent, a combination of the following keys needs to |
| 175 | +be set in the system parameters of the database: |
| 176 | + |
| 177 | +- `mail.default.from`: accepts the local part or a complete email address as value |
| 178 | +- `mail.default.from_filter`: accepts a domain name or a full email address as value |
| 179 | + |
| 180 | +.. note:: |
| 181 | + The `mail.default.from_filter` works only for `odoo-bin` configurations, otherwise this |
| 182 | + parameter can be set using the `from_filter` field on `ir.mail_server`. |
157 | 183 |
|
158 | | -- If ``mail.default.from`` is set, and contains a full email address, all outgoing emails are sent |
159 | | - from the given address. This is a requirement to use `Outlook with Odoo |
160 | | - <https://docs.microsoft.com/en-us/exchange/mail-flow-best-practices/how-to-set-up-a-multifunction-device-or-application-to-send-email-using-microsoft-365-or-office-365#option-1-authenticate-your-device-or-application-directly-with-a-microsoft-365-or-office-365-mailbox-and-send-mail-using-smtp-auth-client-submission>`_. |
| 184 | +If the email address of the author does not match `mail.default.from_filter`, the email address is |
| 185 | +replaced by `mail.default.from` (if it contains a full email address) or a combination of |
| 186 | +`mail.default.from` and `mail.catchall.domain`. |
161 | 187 |
|
162 | | -You access the **System Parameters** in :ref:`developer mode <developer-mode>` in the :menuselection:`Settings --> |
163 | | -Technical --> Parameters --> System Parameters` menu. |
| 188 | +If the `from_filter` contains a full email address, and if the `mail.default.from` is the same as |
| 189 | +this address, then all of the email addresses that are different from `mail.default.from` will be |
| 190 | +encapsulated in `mail.default.from`. |
0 commit comments