From 5d15afdb305d8b2de0de40dadcab2f1d1ede61ed Mon Sep 17 00:00:00 2001 From: std-odoo Date: Fri, 3 Feb 2023 13:57:11 +0000 Subject: [PATCH] [FIX] google_gmail: remove the constraint on the from_filter Bug === Remove the constraint on the from_filter for the Gmail outgoing mail server, because it can be used for custom domain name, and we can allow an email address to send as an other one. E.G. if the user has an email address "admin@mycompany.com" and he activated "all addresses from the domain", he would be able to set - email: admin@mycompany.com - from_filter: mycompany.com to use the mail servers for all email addresses in the same domain. Task-3169015 Ticket-3141747 closes odoo/odoo#113959 X-original-commit: e9426c8b7bd4eb3d5c2c1c89fcf6ee3bdef95b3b Signed-off-by: Thibault Delavallee (tde) --- addons/google_gmail/models/ir_mail_server.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/addons/google_gmail/models/ir_mail_server.py b/addons/google_gmail/models/ir_mail_server.py index 57835f6ebb6..eca7f4ff492 100644 --- a/addons/google_gmail/models/ir_mail_server.py +++ b/addons/google_gmail/models/ir_mail_server.py @@ -64,11 +64,6 @@ class IrMailServer(models.Model): 'Incorrect Connection Security for Gmail mail server %r. ' 'Please set it to "TLS (STARTTLS)".', server.name)) - if server.from_filter != server.smtp_user: - raise UserError(_( - 'This server %r can only be used for your personal email address. ' - 'Please fill the "from_filter" field with %r.', server.name, server.smtp_user)) - def _smtp_login(self, connection, smtp_user, smtp_password): if len(self) == 1 and self.smtp_authentication == 'gmail': auth_string = self._generate_oauth2_string(smtp_user, self.google_gmail_refresh_token)