Configure an external email server on Odoo.com using Amazon Simple Email Service and Route53

Invantive is replacing various application such as JIRA, Confluence, Exact Online and Dlvr.it by Odoo.com (the online edition of Odoo). For background, please refer to Why does Invantive select Odoo as an internal solution and strategic choice?. Maybe even ActiveCampaign and Sendinblue will be migrated, but it remains to be seen whether the volume can be handled.

In this implementation process we experience the “full customer journey” (or sometimes called the “Odoo challenge”) by implementing the software ourselves using manuals, learning videos and basic business software implementation skills. This topic describes the external email server configuration ultimately used on Odoo.com.

Why Use an External Email Server on Odoo.com?

The Odoo.com platforms offers each environment their own email address in the format “company.odoo.com”. Besides incorporating 3rd party in the domain name, the use of company.odoo.com has some disadvantages when email is used extensively for business-critical applications.

The most important disadvantage are restrictions on the number of email that can be sent per day through Odoo’s provided outgoing mail server, starting at 20 mails per day for a trial and 50 for a regular subscription. Odoo enforces such limits to avoid that their outgoing mail servers are listed as frequent spammers, where abusers or intense users cause a service loss for other Odoo users since they share the same outgoing mail server(s).

Such limits are not seen on Invantive’s originating systems such as JIRA or Exact Online, although both JIRA and Exact Online offer very limited to absolute no email delivery analysis tools. In that aspect Odoo shines by providing forms to analyze the mail flow through the outgoing mail server, even up to full SMTP traffic logging.

It is possible to request an increase of the daily outbound email traffic through a ticket, but this can take weeks to process and get approved to a meaningful level. Also, it remains unsure whether the policy applied by Odoo matches the needs of the user for email server capacity.

Another disadvantage is that the qualification of mail originating from Odoo.com is not a hypothetical scenario; mails from Odoo.com users seem to get qualified as spam under circumstances depending of the spam settings along the route to the recipient. Therefore, for business critical use it seems wise to offload the email handling to AWS SES with it’s dedicated handling and possibility for custom IP-addresses.

Configure Odoo Email Domain

First step is to configure the email domain in the Settings app → General Settings. See the picture below where to change the domain:

Configure Odoo Outbound Email Server on AWS SES

Execute the following steps to use AWS SES as outgoing mail server to handle outbound emails:

Configure Odoo Inbound Email Server on Custom Domain

Execute the following steps to forward emails sent to your custom domain to Odoo’s incoming mail server:

  • Go to your terminal window using cmd (Windows) or terminal (MacOS).
  • Start nslookup.
  • Lookup your current email server name for handling mail: set type=MX and company.odoo.com:
  • In this case the mail server is eu165a.odoo.com.
  • Create a hosted zone in your DNS, such as AWS Route53.
  • Instruct external parties to direct all email traffic to the server found:
  • Add additional DNS-records where deemed necessary such as include:amazonses.com in the TXT-record to allow delivery by SES.

Documentation

There is some documentation on changing email servers on Odoo, supported by various integrated web forms:

Please note that the documentation holds for both on-premises and odoo.com installations. This can be confusing sometimes since not all content was written with the different deployment platforms in mind.

Email Configuration Design

In our case we have chosen to delegate outbound email handling to Amazon Simple Email Service using a separate domain erp.invantive.com.

AWS SES can easily handle tens of thousands or tens of millions of outbound emails per day in various configurations. Daily capacity can easily be increased as long as no abuse is made of the service. And excellent throughput is combined with relatively low costs: the so-called “Free Tier” includes 62,000 free emails per month and each 1,000 additional emails cost 10 cents, plus some surcharges for attachments.

For inbound email, we have chosen to relay all inbound emails to the email handler provided by Odoo.com. An MX DNS-record for erp.invantive.com forward all emails to Odoo.com’s handler.

Creating a separate inbound email server was deemed costly, since Odoo.com has great email configuration, introducing frequently new email aliases such as for a new project. An overview of your current email aliases can be found in the menu “Technical” under “Email” and “Aliases”. Please remember to first activate developer mode at the end of the Generic Settings in the Settings app.

Additionally, a separate inbound email server is polled quite infrequently, leading to increased turnaround times for interactions such as on project tasks.

Summarizing, the design is:

  • Use a domain erp.invantive.com.
  • Use AWS SES as outbound mail server.
  • Forward all mail traffic on erp.invantive.com to the default Odoo server.

Caveats

Outbound Port 25 Blocked

The documentation is a little vague about the port to use for outbound mail. Tooltips show port 25 as a candidate, but other documentation forbids it. Ultimate conclusion is that port 25 is not made available for security reasons, even though STARTTLS is possible on it.

Even worse, the connection test displays success with port 25, even when it does not work. So please ignore the connection test and always use the chatter to trigger an outbound email.

For AWS SES TLS (STARTTLS) was chosen using port 587 instead of port 25.

MX-record

An MX-record must refer to a A-record. For erp.invantive.com we have used the following statement to determine Odoo.com’s email handler:

nslookup
set type=mx
invantive.odoo.com

It remains to be seen whether the value eu165a.odoo.com of the MX-record is stable or must be updated whenever Odoo.com changes it configuration.

https://forums.invantive.com/t/configure-an-external-email-server-on-odoo-com-using-amazon-simple-email-service-and-route53/3205

Related Posts