diff --git a/addons/test_mail/tests/test_mail_composer.py b/addons/test_mail/tests/test_mail_composer.py index f683689ee04..92a3f198e74 100644 --- a/addons/test_mail/tests/test_mail_composer.py +++ b/addons/test_mail/tests/test_mail_composer.py @@ -1982,7 +1982,7 @@ class TestComposerResultsComment(TestMailComposer, CronMixinCase): ) # to check behavior of extract_rfc2822_addresses if recipient == new_partner: - smtp_to_list = ['"test.to.1@test.example.com"', 'test.to.1@test.example.com'] + smtp_to_list = ['test.to.1@test.example.com', 'test.to.1@test.example.com'] else: smtp_to_list = [recipient.email_normalized] if exp_alias_domain == self.mail_alias_domain: @@ -2788,7 +2788,7 @@ class TestComposerResultsMass(TestMailComposer): for recipient in recipients: # to check behavior of extract_rfc2822_addresses if recipient == new_partner: - smtp_to_list = ['"test.to.1@test.example.com"', 'test.to.1@test.example.com'] + smtp_to_list = ['test.to.1@test.example.com', 'test.to.1@test.example.com'] else: smtp_to_list = [recipient.email_normalized] if exp_alias_domain == self.mail_alias_domain: diff --git a/odoo/addons/base/models/ir_mail_server.py b/odoo/addons/base/models/ir_mail_server.py index 6f364ae88ab..3704a2c6fcb 100644 --- a/odoo/addons/base/models/ir_mail_server.py +++ b/odoo/addons/base/models/ir_mail_server.py @@ -64,7 +64,7 @@ smtplib.stderr = WriteToLogger() def is_ascii(s): return all(ord(cp) < 128 for cp in s) -address_pattern = re.compile(r'([^ ,<@]+@[^> ,]+)') +address_pattern = re.compile(r'([^" ,<@]+@[^>" ,]+)') def extract_rfc2822_addresses(text): """Returns a list of valid RFC2822 addresses diff --git a/odoo/addons/base/tests/test_mail.py b/odoo/addons/base/tests/test_mail.py index 77ac2950f27..26e36428b1e 100644 --- a/odoo/addons/base/tests/test_mail.py +++ b/odoo/addons/base/tests/test_mail.py @@ -763,9 +763,9 @@ class TestEmailTools(BaseCase): ('"Admin" , Demo ', ['admin@example.com']), ('admin@éxample.com', ['admin@xn--xample-9ua.com']), # formatted input containing email - ('"admin@éxample.com" ', ['admin@xn--xample-9ua.com']), + ('"admin@éxample.com" ', ['admin@xn--xample-9ua.com', 'admin@xn--xample-9ua.com']), ('"Robert Le Grand" ', ['robert@notgmail.com']), - ('"robert@notgmail.com" ', ['"robert@notgmail.com"', 'robert@notgmail.com']), + ('"robert@notgmail.com" ', ['robert@notgmail.com', 'robert@notgmail.com']), # accents ('DéBoulonneur@examplé.com', ['DéBoulonneur@xn--exampl-gva.com']), ]