Management of e-mail domains in Odoo 17
The role and configuration of alias domains
29 February, 2024 by
Management of e-mail domains in Odoo 17
manaTec GmbH, Jan Wiegand
 

The release of Odoo 17 opens up new horizons for a more efficient configuration of the email connection. Of particular note is the ability to create multiple alias domains. In this blog post, we will go into detail about the steps now required to set up an improved email configuration.

The configuration of the e-mail connection in Odoo 17

Up to Odoo version 16, the configuration is complicated without an additional third-party module or an adjustment to the system as soon as the specified outgoing mail server is to be responsible for more than just one domain. This also applies to cases in which several mail servers are used for different email domains. As of Odoo version 17, there is a solution for this, which can already be used in the Odoo standard.

1. Setting up an outgoing mail server for several e-mail domains

Creating an outgoing mail server for more than one e-mail domain would look like this. In the previously set developer mode, we open the "Settings" module and go to the "Technical" menu tab and select the "Outgoing mail server" setting.

Select outgoing mail server

Here we create a new outgoing mail server where we can enter a comma-separated list of domains in the "FROM filtering" field. In the following example, we use the addresses example.org and example-domain.org.

FROM filtering for two different domains

As a result, Odoo now knows that this outgoing mail server should only be used for these two domains and otherwise uses the configuration of the alias domains. You can find out how to create alias domains in the next step and basic information on email aliases can be found here.

2. Creation of alias domains

To create a new alias domain, we go back to the "Technical" menu tab in the settings module and select the "Alias domains" menu item.

Creation of the alias domain

An alias domain should be created for each domain that is used. The following configurations can be made for each domain.

The configuration of the alias domain
  • The deliverability alias: This is used as the address to which bounce messages are delivered. This is the case if, for example, the recipient address does not exist. This mailbox, in our example bounce@domainname, should either be retrieved via a catchall configuration or separately by Odoo. This is important so that Odoo knows that something did not work when sending. We can find this as a return path entry in the email header.
  • ​The catchall alias: This is the set reply address that is used when someone replies to an email. In the email header, this would be the Reply-To entry.
  • The default sender alias: This is used if the sender address does not match the FROM filter set on the outgoing server. This is the FROM entry in the email header.

Odoo compiles these settings as follows: Value@Name or, for example, bounce@example.org.

A list with two alias domains in Odoo looks like this:

List of alias domains

3. Assignment of the alias domains

Once all alias domains have been created, we can now start with the assignment. To do this, we have to select an alias domain for the respective company in the general settings of Odoo in the "Dialog" settings area.

Selection of an alias domain per company

It turns out that we can only ever define one alias domain per company. This means that we cannot work sensibly with only one configured company in Odoo and several e-mail domains. The simplest solution to this problem is to create an additional company in Odoo, which also allows you to benefit from the​ advantages of using company-specific e-mail adresses. Otherwise, the bounce address and the default sender alias would always be used by the only assigned alias domain - even if, for example, the sender domain (FROM) is used by the second email domain. This scenario would look like this:

FROM: mail@example-domain.org
Return-Path: bounce@example.org
Reply-To: catchall@example.org

Technically, this is correct, but many email providers would probably treat the email sent as a possible phishing attempt or spam, as the sender domain does not correspond to the reply address or return path of the email domain. If creating a second virtual company is not a solution for you, the only alternative is to work with email templates you have created yourself for this purpose. 

Conclusion and outlook

The use of alias domains in Odoo 17 offers a flexible solution for managing multiple email domains. However, there are restrictions on the assignment per company, which can be circumvented by creating additional companies or using email templates. In a later blog post, we will discuss the additional option of an email relay server in more detail and show how this can be used as an advanced filter to further optimize the customization of the email connection in Odoo.

If you have further questions about efficient mail management in Odoo 17 or need help, feel free to contact us directly, we are happy to advise you!


Sources: www.odoo.com 

 
Translation values from Odoo 16
Our guide including demonstration module for a successful upgrade