From 4b3f6a32412f1de9250e71d73dda65ce9b935aea Mon Sep 17 00:00:00 2001 From: "Merel Geens (mege)" Date: Tue, 1 Aug 2023 11:04:42 +0000 Subject: [PATCH] [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 --- odoo/addons/base/data/neutralize.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/odoo/addons/base/data/neutralize.sql b/odoo/addons/base/data/neutralize.sql index 809e1958597..69cf3fcd091 100644 --- a/odoo/addons/base/data/neutralize.sql +++ b/odoo/addons/base/data/neutralize.sql @@ -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