Skip to Content
Menu
This question has been flagged
2 Replies
18282 Views

Is there any "Odoo emails for dummies" documentation available ? 

Avatar
Discard

safe link ?

Author

@imad yes it is. But fyi, I plan to copy the content directly here in the upcoming days!

Author Best Answer

Dear,


Here is comes : https://drive.google.com/file/d/121Kk2hQNERNvbTHMpXB7gDBRK3x4k4S7/view?usp=sharing


Should you have any additional comment to make, or any doubt, or any question related to this, feel free to add a comment!

Thanks,

Caroline

Avatar
Discard

Any chance there is an updated version of this document? I find it very helpful but want to make sure it is still current.

Best Answer

Outgoing mail server documentation

Table of content

1. What is a mail server ?

2. Odoo mail server specifics  

    2.1 Is Odoo a mail user agent? 

    2.2 Configure your Odoo mail server  

     2.2.1 Mandatory

     2.2.2 Set up aliases  

     2.2.3 Set up a catchall  

     2.2.4 Set up my own domain in Odoo

3. Set up a custom outgoing mail server  

    3.1 How to ? 

    3.2 GSuite 

    3.3 Mass mailing specifics  

Default daily limit : 200 mails/day  

Best practice  

1. What is a mail server ? 

Even if you don't need to know how SMTP works to send an email, here is how it works (just for your culture you dummy!). 

To send a mail, you use an Mail User Agent (MUA), it is generally of 2 types:- a webmail (when you connect online) (gmail, for instance) 

- a mail client (software installed on your computer such as Outlook, ThunderBird, Smartphone application, ...) 

When you send your mail, your MUA : 

1. will convert your mail to text format (even the attachments will be converted to text) 2. will connect to the mail server (=SMTP server) that is set up and send the text. 

Then the mail server will send the mail to the recipient. The mail will then travel from server to server, until it reaches the recipient's mailbox server.

A small comparison with what happens when you send a paper mail should make it easier to understand all this. (in red, all operations performed by the SMTP server (AKA mail server) or the SMTP relay). 



The comparison between an SMTP mail server used to send email and a postal provider is therefore easy. Just as using the post office or UPS does not change the recipient or sender address, using any SMTP server (OVH, Gmail, Office 365, Odoo,...) does not change anything to the workflow for the end-user. 

If you see what I'm getting at, you now understand that Odoo offers two distinct services: - Some sort of mail user agent (BUT not exactly).... 

- A built-in SMTP outgoing mail server (BUT then, why do we allow our clients to set up an outgoing mail server on our databases ? )


2. Odoo mail server specifics 

    2.1. Is Odoo a mail user agent? 

First of all, it’s NOT correct to consider Odoo as a mail user agent. We don’t have the ambition to replace the customer's mail user agent. We are not there to replace gmail, office 365,... Our client will still need his main mail user agent. We are just mirroring some communications in Odoo to help our customer centralize information in the database. 

Let’s take a small example. 

When I click on “send a message” to send an email to my customer through the opportunity form chatter, I actually create a new record in a chatter. As a result, 

- Odoo sends an email to all the followers of the record (except the user who sent the email) - Odoo copies the text I wrote in the chatter in the email body 

- Odoo sets the sender address, using the one on the contact form of the user who performed the operation : sent by user@company.odoo.com using company.odoo.com - Odoo sets a reply-to address : catchall@company.odoo.com 

- When the customer hits “reply-to”, he replies to “catchall@company.odoo.com”. 

Okay, but what the @#|& is the catchall ? 

Well, when the client hits “reply-to”, what happens? Getting back to our postal service comparison, you can picture yourself the following : 

- Your database is your company building 

- Each floor is a model (contact, product, opportunity,....) 

- Each office is a record (John Doe, James McCain, product A, opportunity Z,...) 

- The catchall is the mail guy who does the mail distribution each morning. 

When the catchall receives a mail, it returns it right to the chatter of the record which it came from. 

You can call it whatever you want, change its name to something more suitable for your customer like "reply@company.odoo.com" if you want. Just remember that, just like in any orchestra, there can only be ONE conductor in an Odoo database (so, even in a multi-company environment, you can only have one catchall alias!). 

Then, what happens when the catchall replaces the mail in the correct chatter ? 

1. Odoo put the text the sender wrote back into the correct chatter ; 

2. Odoo sends an email to all the followers of the record (except the user who sent the email), warning them there has been a reply ; 

a. Odoo copies the text in the chatter in a new email body ; 

b. Odoo sets the sender address, using the one on the contact form of the user who performed the operation : sent by customer@clientmail.com using company.odoo.com ; 

c. Odoo sets a reply-to address : catchall@company.odoo.com ;


So, can I connect or synchronize Odoo mail to my MUA (gmail, office 365,...) ? 

No you can’t, you dummy, because it makes no sense. As explained, Odoo just : 

- sends emails impersonating you in case you, as an Odoo user, record a text in the chatter ; - sends you a copy of the mails the database receives, in case you are a follower of the chatter. 

2.2. Configure your Odoo mail server 

You will find in this section all the configurations you need to do to make sure our Odoo built-in mail server will work properly, and other configurations of interest. 

    2.2.1. Mandatory 

Legitimate the fact that an odoo server uses your mail domain address, otherwise the recipient’s email server may consider your mail as spam. In order to do so, you need to properly configure your SPF, DKIM and DMARC at your DNS level. 

If it all seems chinese to you, don’t panic, and let’s just get back to our post comparison, and imagine the following : 

In the world of mailing, it is necessary that the postal service affixes the stamp on the envelope. And when they affix the postage, the standard is to draw a circle on the stamp. 

All mailing services work in this way. Therefore, when an envelope is postmarked differently, with a square design for example, it is thrown directly into the trash when it is sorted because it is suspected of being fraudulent. 

But let's imagine for a moment that if there's a note in the corner that says, "Hey, I know this particular postage isn't standard, but I certify it's ok and not fraudulent - signed by the sender." Then, the post mail passes the control check. 

Well, it’s what Odoo does : When impersonating the mail address (remember “send by john@company.com using company.odoo.com” ?), Odoo uses an impersonation technique that is very popular among spammers, and therefore, a lot of DNS spot it and trash it directly to the spam folder. But if your customer allows Odoo to use this technique at his DNS level, then the other DNS, when sorting the email, will also receive the information that Odoo is allowed to use this technique and won’t trash it. 

To do so, ask your client to get help from his system administrator or ask our technical teams for help (time charged on the success pack). 

Some indications however : 

You have to create or edit the following record in the DNS zone : SPF, DKIM and DMARC

> SPF 

To be SPF-compliant, you need to authorize Odoo as a sending host in your domain name settings: 

● Sign in to your domain’s account at your domain host. 

● Locate the page for updating your domain’s DNS records. 

● If no TXT record is set, create one with following definition: v=spf1 include:_spf.odoo.com ~all ● In case a TXT record is already set, add "include:_spf.odoo.com". 

e.g. for a Gmail server it should be: 

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

Find here the exact procedure to create or modify TXT records in your own domain registrar : https://www.mail-tester.com/spf/ 

Your new SPF record can take up to 48 hours to go into effect, but this usually happens more quickly. 

Danger: in all likelihood, an SPF record should already exist on your domain to allow to send emails for your domain; make sure to modify the existing record to add _spf.odoo.com in it and not to add a second record as having multiple SPF records is not standard-compliant and will cause fraud detection issues 

> DKIM is a CNAME record 

You should do the same thing if DKIM (Domain Keys Identified Mail) is enabled on your email server. In the case of Odoo Online & Odoo.sh, you should add a DNS “odoo._domainkey” CNAME record to “odoo._domainkey.odoo.com”. For example, for “foo.com” they should have a record “odoo._domainkey.foo.com” that is a CNAME with the value “odoo._domainkey.odoo.com”. 

host ==> "odoo._domainkey.example.com" 

points to ==> "odoo._domainkey.odoo.com" 

> DMARC is a TXT record 

host ==> _dmarc.example.com 

TXT value ==> v=DMARC1; p=none; sp=none; aspf=r; adkim=r; pct=100 

To validate these records, you can use external tools such as https://mxtoolbox.com to analyze the SPF and DKIM records for your domain (DKIM validation requests should use the “odoo” selector, e.g. wayne.com:odoo)

    2.2.2. Set up aliases 

An alias is used to receive emails in Odoo and create new records in the model it is linked to. 1. You can set up an alias in the settings of : 

- expenses, CRM (if you enabled the leads) 

- the sales, quality and help desk teams 

- any project

- the PLM types 

- any purchase journal (Accounting) 

- any job position (Recruitment) 

- …Not pretending to be exhaustive... 

This alias will be used to receive emails in Odoo and create new records in the model. In addition, if the alias is set, you will also notice that in any communication you have with the client, the reply-to address will not be @mycompany.odoo.com, but 

@mycompany.odoo.com. 

2. To set up an alias, as of V14, you will need to first set up the domain name to use for emails. If you are satisfied with odoo domain (mycompany.odoo.com), you can use it: 

> Settings 

> Check “external mail servers” 

> Add Odoo domain name 

> DON’T set up any mail server. 

If you consider using yours, go to section 2.2.5. 

3. You can also link an existing alias to a user. In this case, any email sent to this alias will create a new record in the model it’s linked to and trigger a notification for the user. Also, for most mail template, the “From” address is the mail alias of the user (if set, if not, then the system uses the user’s contact’s email address) 

> Note: an alias can only be used once so it must be unique. 

> Go to settings > Users > Select a user > Preferences tab > Select an alias. 

4. If you don’t want an email to come “From” a user, then set a fixed email address on the email template (https://drive.google.com/file/d/1m8FnnTTZcOxDGafwXu9EoJq5cbO0KMen/view) 5. TIP : Just a note for best practice, @company.odoo.com is very prone to spam. Better to use something a little less obvious like @company.odoo.com or other. We’ve seen this become an issue for CRM leads email alias. Explicit leads came through.

    2.2.3. Set up a catchall 

If you don’t want to use the term “catchall” and have something else in mind, we can change it in (debug) system parameters. 

    2.2.4. Set up my own domain in Odoo 

A domain name is the equivalent of your postal address on the Internet: 

Odoo will automatically create a domain for you : < mycompany.odoo.com >. Your contacts will see it when they hit reply-to to an email. 

However, you can set up your own domain on your database (if you own one!). Then, you will be able to use @company.com instead of @mycompany.odoo.com. But why would you want to do so ? 

Well, for the outgoing mail, if you read the first part of this documentation, you understand that in most cases, it is useless (since Odoo will anyway use the mail on the contact form as the sender address) 

But if you also wish to use your domain for incoming emails (e.g. info@wayne.com to create leads instead of info@wayne.odoo.com, support@wayne.com to create helpdesk tickets, etc.), it starts to be interesting to have a domain setup, because the address appears more trustworthy to your recipient, who will send an email to “sales@mycompany.com” instead of “sales@mycompany.odoo.com”. 

Here are the steps to follow : 

1. Set up aliases where you want to use them (lead, helpdesk,...) 

2. Configure your custom email domain in Odoo, go to Settings > General Settings, check the “External Email Server” checkbox and put the domain in the field that appears (e.g. “wayne.com”). You should not configure any outgoing mail server in Odoo itself.

3. Create the relevant mailboxes in your DNS (domain name server) interface and forward them to their corresponding Odoo aliases: 




Note that for every alias you create in Odoo (e.g. for sales teams, projects, expenses, etc.), you must create a corresponding inbox and forwarding rule in your DNS interface. 


3. Set up a custom outgoing mail server 

Why do we allow our customers to set up another outgoing mail server?

2 reasons to use your own outgoing mail server : 

        1. Send more than 200 mail/day 

To avoid putting at risk the reputation of odoo’s server (= avoid being blacklisted), Odoo limits the amount of outgoing mails with it’s own mail server at 200 mail/day/database. 

For mass-mailing specifics, go to the last section. 

        2. For security matters 

/!\ Good to know : THERE IS NO WAY TO CONFIGURE AN OUTGOING MAIL SERVER WITH OFFICE 365 OR OUTLOOK ON AN SAAS OR SH DATABASE 

Curious to know why? 

Because we need to provide an IP address to authenticate with Office 365, and both on SAAS and SH databases, IP address depends on the server where the DB is hosted. However, we often do some rebalancing, which means moving a DB from one server to another. Therefore, it is impossible to guarantee a fixed IP address for this type of hosting. 

Only an on premise hosting allows it, because then, as the DB is hosted locally, the IP address is permanent. 

    3.1. How to ? 

First, you need to configure your security system at the DNS level (SPF, DKIM and DMARC, ask to your administrator system) (see infra) 

Second, you need to configure your domain (see infra) 

Finally, you need to configure an outgoing mail server and optionally an ingoing mail server : 1) You will need to go to the Settings App > General Settings then enable the setting for External Email Servers 

a. For the “alias domain” field you should enter the domain that comes after the @ symbol in your email address. For most companies this is the same as their website domain (Ex. Disney.com) 

b. Next click “Configure outgoing server”. You’ll want to do an internet search for how to do this for your specific mail provider. 

c. Click create and fill in all the fields and click test. (see example below)

Here’s an example for Gmail Outgoing Server: 

2) Next you need to configure your Incoming Server. 

a. Activate Developer Mode > Go to Settings App -> Technical -> Incoming mail servers b. Click create and add your email server info. You should leave the fields for “Actions to Perform Incoming Mails” blank 

Here’s an example for Gmail Incoming Mail Server: 

c. Once configured you should test and confirm. Check to see if the status changes to “confirmed”. (see image below)

4) Test sending an Odoo message to yourself and then from your e-mail back to Odoo. You may need to Run the Fetchmail Scheduler manually to speed up your testing. Go to Developer Mode > Settings App > technical > Scheduled Actions > Fetchmail Service > Run Manually. See image below:

 

3.2. GSuite 

Here are the steps to follow to configure it with GSuite : 

    1. In the General Settings, enable the External Email Servers and set the Alias Domain (i.e. : mydomain.com). 

    2. Create and configure the Outgoing Email Server as follow : 

        - Description : GSuite 

        - SMTP Server : smtp.gmail.com 

        - SMTP Port : 465 

        - Connection Security : SSL/TLS 

        - Username : john.doe@mydomain.com (this user has to be the administrator of the GSuite account) - Password : [Ask your customer] 

3. Go to the administration of GSuite by using the username and the password above. 4. Go to Manage your Google Account > Security and turn on the "Less secure app access" feature. 5. Wait five minutes and test the connection from Odoo. 

6. Go to the administration of GSuite and create a new user with this following email : catchall@mydomain.com (are you surprised ?). 

7. Go to the Gmail settings > Advanced Settings > Routing > Recipient address map and create the following mapping : catchall@mydomain.com,catchall@mydomain.odoo.com. 

8. Don't forget to save the configuration. 

9. Try it by sending an email through the chatter and answer. 

10. Refresh the chatter and enjoy the result by drinking a beer. 

Here is a video of the process : 

https://drive.google.com/file/d/1ISzepp3vE6Ea_niFLGazM5GavuM08wbr/view 

3.3. Mass mailing specifics


All our customers are using, by default, a shared email server run by Odoo. These public servers have a reputation rating which is widely used by email providers worldwide in order to prevent forwarding spam to their customers. When several reports are made regarding spam sent by an email server, the server can simply be blacklisted by providers. In the best case, emails sent from this server end up in the "Spam" folder; in the worst case, the email is simply deleted and never reaches the recipient. 

Therefore, you will easily understand that an improper use of our system by a minority of customers will impact ALL our customers. If a single customer uses our system improperly, it can lead to the blacklist of our email servers: all emails sent from these servers will be considered as spam, which will affect everyone using our platform. It is then the job of our support team to fill in the necessary "paperwork" in order to "unblacklist" the email servers. 

But what is an improper use of our email system? (see also our Acceptable Use Policy: https://www.odoo.com/page/odoo-online-acceptable-use-policy) 

1. Spam/scam/phishing... 

Spamming, scamming and phishing obviously degrades the rating of our email servers. 

2. No "Unsubscribe" link. 

All newsletters must include an "Unsubscribe" link. The business might be legit, but the customers must have the choice of receiving or not the newsletters. This is defined for each partner in the form view under "Opt-Out": "If opt-out is checked, this contact has refused to receive emails for mass mailing and marketing campaign." 

Any user clicking on the "Unsubscribe" link will be set as "Opt-Out". 

3. The bounce rate 

Emails must be sent to existing addresses. Several use cases can appear: 

- the user imported (semi-)random addresses that he bought online 

- duplicate email addresses are found in the mailing lists 

- invalid addresses (deprecated, typo...) 

When an email server has a high bounce rate, it will be publicly considered as sending emails to random addresses. Ultimately, it is considered as sending spam. An acceptable bounce rate for a mass-mailing is around 1%: this might seem very low, but other mass-mailing providers such as MailChimp or MailInBlue have the same expectations from their customers. 

Default daily limit : 200 mails/day 

The default daily limit is 200 emails/day for a paid database. It is 20 emails/day for a free database (free trial or 'One App Free' database). Internally we can Increase Email limit on a database with _odoo/support. 

If you need more than 400, create a support ticket. 

On a practical point-of-view, when a request is filed in order to increase the email limit of a customer, we will never make a big step in the increase of the limit authorized. We will never go from 200 mails/day to 5000 in one step, but always increase step-by-step. The reason is that we don't have any automated monitoring tools of the email sent by our customers: all checks are performed manually, so we must make sure to trust the customer before any step up. The customer might run a legit business, but use an old mailing list which hasn't been cleaned for years.

For a new customer, we accept to raise this limit to 1,000 emails/day if the following criteria are met: 

● Email templates seem legit (i.e. related to database content, legit newsletter/offer, etc.) ● Mailing lists seem lawfully acquired and sane 

● An unsubscribe link is present in the email template 

We can make an exception for customers with a good track record and more than just the email marketing app. 

Therefore, please do not ask to raise the limit to thousands of emails per day for a new customer. The reason for this is that a spammer can blacklist all our customers who are sharing the same email server. 

The customer can circumvent the 1,000 email/day limit by setting up their own outgoing email server in Odoo (Settings > Technical > Email > Outgoing email server). But even in this case, Odoo might take a long time to put all emails in the queue and process the queue. 

You can ask for customization (from pack - about 2 hours to be on the safe side, more if their use case is not to simply send e-mail) to increase performance if they want to send their e-mail rapidly (e.g. in less than 24-30 hours for 90k emails) 

Best practice 

LNA > As a side note, it’s also good to know that it's seen as good practice to differentiate (i.e. use different servers) "transactional" emails (sending a sale order, an invoice, ...) from Marketing ones (mass mailings about an offer, newsletter, ...) so that getting a poor server reputation on the marketing side (because recipients don't engage with this content and consider it spammy) does not create issues on the business side (people not seeing an invoice because the email ended up in the spam folder or got rejected by the recipient). 

In Odoo, that is reflected by the ability of selecting a priority outgoing server for either all Mass mailings (https://tinyurl.com/tegfq37) or can also be done on a mailing basis (in debug mode, https://tinyurl.com/t66czcr)
Avatar
Discard
Related Posts Replies Views Activity
1
Apr 25
5514
0
Mar 25
517
1
Mar 25
30
0
Mar 25
438
3
Sep 24
3514