Files
odoo_source/odoo/addons/base/data/neutralize.sql
T
Merel Geens (mege) 4b3f6a3241 [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>
2023-08-08 13:08:20 +02:00

24 lines
732 B
SQL

-- deactivate mail servers
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
WHERE id NOT IN (
SELECT res_id
FROM ir_model_data
WHERE model = 'ir.cron'
AND name = 'autovacuum_job'
);
-- neutralization flag for the database
INSERT INTO ir_config_parameter (key, value)
VALUES ('database.is_neutralized', true)
ON CONFLICT (key) DO
UPDATE SET value = true;