Repository
OCA/mail · module folder · Try on Runboat
Module version
1.0.0
Category
Discuss
Folder size
0.07 MB
License
LGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/mail
Last tracking update
2026-08-07 09:06:26
Authors
Odoo Community Association (OCA), LasLabs, Adhoc SA, braintec AG
Maintainers
Odoo Community Association (OCA), LasLabs, Adhoc SA, braintec AG
Committers
Weblate, OCA-git-bot, oca-ci, andrea
Odoo dependencies
odoo/odoo:
Python dependencies
None
System dependencies
None
Required by
None
Description
This module brings Odoo outbound emails in to strict compliance with
RFC-2822 by allowing for a dynamically configured From header, with the
sender's e-mail being appended into the proper Sender header instead. To
accomplish this we:

- Add a domain whitelist field in the mail server model. This one
  represent an allowed Domains list separated by commas. If there is not
  given SMTP server it will let us to search the proper mail server to
  be used to send the messages where the message 'From' email domain
  match with the domain whitelist. If there is not mail server that
  matches then will use the default mail server to send the message.
- Add a Email From field that will let us to email from a specific
  address taking into account this conditions:
  1)  If the sender domain match with the domain whitelist then the
      original message's 'From' will remain as it is and will not be
      changed because the mail server is able to send in the name of the
      sender domain.
  2)  If the original message's 'From' does not match with the domain
      whitelist then the email From is replaced with the Email From
      field value.
- Add compatibility to define the smtp information in Odoo config file.
  Both smtp_from and smtp_whitelist_domain values will be used if there
  is not mail server configured in the system.

Code Analysis

Views touched (1)
XML IDNameModelTypeStatus
ir_mail_server_form IR Mail Server - From Address ir.mail_server form Inherits base.ir_mail_server_form
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (1)

New fields (2)
  • domain_whitelist Char
    help="Allowed Domains list separated by commas. If there is not given SMTP server it will let us to search the proper mail server to be used to sent the messages where the message 'From' email domain match with the domain whitelist."
  • smtp_from Char
    help="Set this in order to email from a specific address. If the original message's 'From' does not match with the domain whitelist then it is replaced with this value. If does match with the domain whitelist then the original message's 'From' will not change" string='Email From'
Public methods (6)
  • check_valid_domain_whitelist(self)
    @api.constrains('domain_whitelist')
  • check_valid_smtp_from(self)
    @api.constrains('smtp_from')
  • create(self, vals_list)
    @api.model_create_multi
  • send_email(self, message, mail_server_id=None, smtp_server=None, *args, **kwargs)
    @api.model
  • unlink(self)
  • write(self, values)

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…