Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
7231 Vistas

I'm trying to setup the smtp values in the odoo.conf, this values are found in the example config file in https://github.com/odoo/docker/tree/16d5988408434e4678f3bf6318aabad542dec4ee/11.0:

; smtp_password = False
; smtp_port = 25
; smtp_server = localhost
; smtp_ssl = False
; smtp_user = False

However, if I uncomment this lines and change them to a valid smtp server, when I start Odoo and check the config it still has the default values and the emails are not sent. Is there something I'm missing?


Note: I'm setting up multiple instances, I need this config to be injected rather than configured manually in each instance.


Thanks

Avatar
Descartar
Mejor respuesta

Theses parameters are used only if no smtp server are found in the database, code extract:

```python

mail_server = self.sudo().search([], order='sequence', limit=1)

if mail_server:

            smtp_server = mail_server.smtp_host

            smtp_user = mail_server.smtp_user

            smtp_password = mail_server.smtp_pass

            smtp_port = mail_server.smtp_port

            smtp_encryption = mail_server.smtp_encryption

            smtp_debug = smtp_debug or mail_server.smtp_debug

else:

            # we were passed an explicit smtp_server or nothing at all

            smtp_server = smtp_server or tools.config.get('smtp_server')

            smtp_port = tools.config.get('smtp_port', 25) if smtp_port is None else smtp_port

            smtp_user = smtp_user or tools.config.get('smtp_user')

            smtp_password = smtp_password or tools.config.get('smtp_password')

            if smtp_encryption is None and tools.config.get('smtp_ssl'):

```

So, in order to use the smtp values in the odoo.conf (or command line) the default mail server must be removed (or archived), then the system will use the provided arguments

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
5
sept 24
12150
2
oct 24
4114
5
oct 16
8760
1
mar 15
13635
0
dic 24
1468