[IMP] base: insert dummy SMTP server

The current neutralization implementation for ir_mail_server deactivates
existing servers. This can still result in mails being sent if an SMTP
server was specified on the command-line. To prevent that from happening
a dummy SMTP server is defined that doesn't resolve to anything.

I've opted to use the "invalid" domain for this purpose:
https://www.rfc-editor.org/rfc/rfc6761#section-6.4 .

closes odoo/odoo#131138

X-original-commit: 4ceed406ead570b00e6e8973e55866bee4c84de8
Signed-off-by: Merel Geens <mege@odoo.com>
This commit is contained in:
Merel Geens (mege)
2023-08-08 13:08:20 +02:00
parent a6049398e3
commit 4b3f6a3241
+4
View File
@@ -2,6 +2,10 @@
UPDATE ir_mail_server
SET active = false;
-- insert dummy mail server to prevent using fallback servers specified using command line
INSERT INTO ir_mail_server(name, smtp_port, smtp_host, smtp_encryption, active, smtp_authentication)
VALUES ('neutralization - disable emails', 1025, 'invalid', 'none', true, 'login');
-- deactivate crons
UPDATE ir_cron
SET active = false