Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
7252 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
5
zář 24
12195
2
říj 24
4165
5
říj 16
8800
1
bře 15
13668
0
pro 24
1505