0f4dfb4459fdf83857542fccd351aa0ea437f272
Purpose
=======
The global purpose of this PR is to improve the score of the emails sent by
Odoo as well as allowing to authenticate the Odoo server with SSL certificate.
SSL authentication
==================
We want to be able to authenticate our servers with a certificate for the
entire domain name instead of using an username and a password. That way
we will be able to configure an SMTP relay (on Office 365 e.g.) based on an
SSL certificate instead of an hard-coded IP address.
The host name of the server is defined in the MX DNS record on your domain.
The certificate must be valid for your domain name.
e.g.
> Host: openerp-org.mail.protection.outlook.com
Port: 25
Username: \<keep it blank>
Password: \<keep it blank>
Security: STARTTLS
Email: admin@odoobe.com
No spoofing
===========
Before, we were spoofing the FROM headers all the times. E.g., if someone has
an email address outside of the current email server (e.g. `test@gmail.com`)
we sent it using the default mail server and we spoofed the FROM. This causes
some issues, because emails may be marked as spam by the email clients. A
small fix for stable was merged at odoo/odoo#69218 and will be reverted as this merge
improves that behavior.
Now, we try to *not* spoof the mail from in the SMTP protocol. For that purpose
we define a default email address which is used when no mail server is
available for the sender email address. In that case, the email address
of the sender will be "encapsulated" in the default email address
(e.g. `"Admin (admin@gmail.com)" <notifications@odoo.com>`).
To know for which email address an outgoing mail server can be used, we use a
field "`from_filter`" which can be either an complete email address or a
domain name.
The headers are changed following this heuristic
1. We first look for a mail server which match the entire mail FROM
in that case, we do not change the email header (not needed)
2. If not found, we search a mail server which match the domain name of
the mail from (do not need to change the headers in that case)
3. If not found, find the mail server linked to the "notifications"
email (defined in the system parameter). Then change the FROM header
to the notifications email, and put the old one in the name part of
this header.
e.g.
Initial mail from: "Admin" < admin@example.com >
Final mail from: "Admin (admin@odoo.com)" < notifications@odoo.com >
4. If no notifications email is configured or if no mail server are
found for the notifications email, fallback to the old system and
spoof the FROM header. In that case we do not have the choice if we
want to send the email, he will probably be marked as spam.
LINKS
Task-2367946
closes odoo/odoo#61853
Related: odoo/upgrade#1903
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
…
…
…
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%