diff --git a/mail_environment/models/ir_mail_server.py b/mail_environment/models/ir_mail_server.py index 984cce41c..322fd51c9 100644 --- a/mail_environment/models/ir_mail_server.py +++ b/mail_environment/models/ir_mail_server.py @@ -16,11 +16,19 @@ def _server_env_fields(self): "smtp_port": {}, "smtp_user": {}, "smtp_pass": {}, + "smtp_ssl_certificate": {}, # the value must be base64 encoded + "smtp_ssl_private_key": {}, # the value must be base64 encoded "smtp_encryption": {}, + "smtp_authentication": { + "compute_default": "_compute_default_authentication" + }, } mail_fields.update(base_fields) return mail_fields + def _compute_default_authentication(self): + self.update({"smtp_authentication": "login"}) + @api.model def _server_env_global_section_name(self): """Name of the global section in the configuration files diff --git a/mail_environment/readme/CONFIGURE.rst b/mail_environment/readme/CONFIGURE.rst index 4ff2783e4..bf268ab01 100644 --- a/mail_environment/readme/CONFIGURE.rst +++ b/mail_environment/readme/CONFIGURE.rst @@ -38,3 +38,10 @@ Example of config file :: You will need to create 2 records in the database, one outgoing mail server with the field `name` set to "odoo_smtp_server1" and one incoming mail server with the field `name` set to "odoo_pop_mail1". + +It is possible to use a SSL certificate for SMTP authentication. In this case, +you need to set the following entries in the configuration entry :: + + smtp_authentication = certificate + smtp_ssl_certificate = + smtp_ssl_private_key =