In your odoo inventory you have to add:
nginx_sites:
...
...
odoo.ssl:
- |
...
...
location /mailhog {
chunked_transfer_encoding on;
proxy_set_header X-NginX-Proxy true;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
proxy_redirect off;
proxy_buffering off;
proxy_pass http://mailhog;
}
for allow nginx to acces to mailhog
and enable mailhog and configure basic auth
mailhog_enabled: true
mailhog_basic_auth_enabled: true
mailhog_basic_auth_user: <username>
mailhog_basic_auth_pass: <password>
mailhog_basic_auth_file: "{{ mailhog_install_dir }}/auth -ui-web-path=mailhog"
With this configuration you can enter to https://yourserver/mailhog and see mailhog Inbox.
You have to go to Settings\Technical\Outgoing Mail Servers and create new mail server.
The SMTP Server is localhost and the port is 1025.
The Connection Security is none.
After that, when you send a email from Odoo the response will be received in mailhog (https://yourserver/mailhog)