Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
7259 Widoki

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

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
5
wrz 24
12214
2
paź 24
4172
5
paź 16
8807
1
mar 15
13687
0
gru 24
1509