Cloudflare domain and incoming mail
If your domain's DNS is on Cloudflare, you don't have to add records by hand. Give the platform a Cloudflare API token and it sets up DNS, the SSL certificate and, if you want, incoming mail in Odoo. This page walks through each step.
Before you start
- The domain is added to your Cloudflare account and its status there is Active.
- You can sign in to Cloudflare to create an API token.
- For incoming mail: the domain is the main domain (
yourcompany.com, noterp.yourcompany.com).
Note
Not on Cloudflare? Follow Custom domain DNS setup instead and add the records at your own DNS provider.
1. Create a Cloudflare API token
Open your instance, go to the Domains tab and choose Connect with Cloudflare. The in-app guide Create a Cloudflare API token takes you through these steps:
What will you use the token for? Pick Website only (DNS and the SSL certificate) or Website and email (also routes mail sent to your domain into Odoo). You can add permissions to the same token later.
Open Cloudflare opens Cloudflare's token form with the permissions already selected.
Check that the form lists these rows:
Website only Website and email Zone · Zone · Read Zone · Zone · Read Zone · DNS · Edit Zone · DNS · Edit Zone · SSL and Certificates · Edit Zone · SSL and Certificates · Edit Zone · Config Settings · Edit Zone · Config Settings · Edit Zone · Zone Settings · Read Zone · Zone Settings · Edit Zone · Email Routing Rules · Edit Account · Workers Scripts · Edit Under Zone Resources choose Specific zone and your domain. Leave your account selected under Account Resources.
Press Continue to summary, then Create Token.
Press Copy on Cloudflare's confirmation page and paste the token into the platform. Cloudflare shows it only once.
Tip
A token limited to one zone can only touch that domain. That is the safest choice, and it is what the prepared form suggests.
2. Connect the token
Paste the token into Cloudflare API token and press Connect Cloudflare. If you already have a token, use I already have a token.
One connection can manage domains on several instances. You see every connected token under Profile → Integrations, with whether it still works and which domains use it. Remove makes the platform forget a token; the token itself stays in Cloudflare, so delete it there too if you no longer need it.
3. Set up the domain
In Set up with Cloudflare:
- Pick the domain from the list (Reload list if you just added it to Cloudflare).
- Optionally type a Subdomain (for example
erp); leave it empty to use the domain itself. - Press Set up domain.
The platform then:
- writes a proxied A record (orange cloud on) pointing at your instance,
- issues a 15-year Cloudflare origin certificate for it, so traffic is encrypted all the way to the server,
- for a main domain, also makes www.yourcompany.com redirect to yourcompany.com.
The card changes to Managed by Cloudflare and shows the DNS record, the certificate and the zone. The platform never changes your zone-wide SSL setting; it only adds a rule for this host name.
Note
If your account needs approval for domains, you see Request received. The domain is set up automatically once an admin approves it.
4. Install the Mail app
Incoming mail is part of the Mail app. Open Apps in the sidebar, choose Mail, pick your instance and press Add to Instance. This installs the mail module in your Odoo. After that the Domains tab shows the mail settings for the instance.
5. Turn on incoming mail
Under Incoming mail press Receive mail in Odoo. From then on, every email sent to any address at your domain (a "catch-all") reaches Odoo within a few minutes. Your token needs the Website and email permissions for this.
Incoming mail works only on the main domain. A catch-all on a subdomain would take over every address of the company, so the button is not offered there.
If the domain already receives mail elsewhere
If your domain already has MX records pointing at another mail provider (Google Workspace, Microsoft 365, your hosting company), the platform stops and shows This domain already receives mail elsewhere with the current mail servers.
Warning
Replace and continue replaces those MX records with Cloudflare Email Routing. The mailboxes at your old provider stop receiving new mail. Only continue if all mail for the domain should go to Odoo.
Stop receiving mail puts the catch-all back the way it was. Mail that already reached Odoo stays there.
The Shared Inbox in Odoo
Mail arrives in Odoo's Shared Inbox app.
- Inbox lists the messages grouped by the address they were sent to, with the sender, subject, a short preview and an attachment marker. Filter by To do, Assigned to me, Unassigned or Done.
- Open a message to read it and reply from the conversation. The buttons on top:
- Assign to me takes ownership.
- Mark as done closes it; Reopen brings it back.
- Convert to lead (when CRM is installed) and Convert to task (when Project is installed) move the message and its attachments to a new record. If the sender replies later, the reply goes to that lead or task, not back to the inbox.
- Addresses (administrators) shows which address goes where. Apps create these: a sales team's alias in CRM (for example
sales@), a project's alias in Project. Mail to any other address lands in the inbox.
Replies to mail sent from Odoo go back to their own conversation, as usual.
Security
A catch-all receives everything, including mail nobody asked for. These protections keep it manageable:
- Sender checks. Cloudflare refuses mail that fails the sending domain's DMARC policy before it reaches Odoo. Messages whose sender could not be fully verified are delivered but flagged, so you know not to trust the address shown as the sender.
- Spam. Each message gets a spam score. Suspicious mail goes to the Spam view instead of the inbox. Not spam moves a message back; Block sender sends it to spam and rejects the sender's future mail.
- Hourly limits. If one sender, or one of your addresses, receives too many messages in an hour, further mail is refused temporarily. Real mail servers retry later, so legitimate mail still arrives; a flood does not fill your Odoo.
- Dangerous attachments. Mail carrying executable files, scripts or disk images (the same kind of list Gmail blocks) is rejected, and the sender is told why. This also applies to such files inside a
.zip. - Size. Messages larger than 25 MB are rejected, which is Cloudflare's own limit.
Outgoing mail
Sending mail from your own domain through Mailtrap is set up on request. Open Support & feedback and tell us the instance and domain. Until then Odoo sends with its default settings.
Troubleshooting
- "Cloudflare did not accept this token": the token was mistyped, deleted, or has expired. Create a new one with the guide.
- "The Cloudflare token lacks the … permission": open Edit the token in Cloudflare, add the named permission and try again. A token made for Website only needs the extra mail permissions before incoming mail can be turned on.
- "This domain is not in the connected Cloudflare account": the token is limited to another zone, or the domain is in a different Cloudflare account. Connect a token for the right account.
- The domain shows "not active on Cloudflare yet": finish adding the domain in Cloudflare (change the nameservers at your registrar) and wait until Cloudflare shows it as Active.
- No mail in the Shared Inbox: check that Incoming mail shows On, look in the Spam view, and allow a few minutes after turning it on.