Skip to content

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Dec 9, 2024

When preparing final outgoing email, partner email is normalized. We take their formatted email, which is their name and their normalized email. However email_to and email_cc are taken from input using 'email_split(_and_format)', which finds emails but do not format them.

This leads to incoherent behavior as most emails are normalized as we generally always use partners, but not all. In this commit we now split, normalize and format email_to and email_cc in outgoing emails.

This fixes a first issue where name are lost if a formatted email was entered in email_cc field. Only address was kept, now the name is correctly found and put back.

This also fixes an issue for validated email detection, in order to compare normalized emails. This was introduced at #185793 and may skip valid emails entered in email_to or email_cc.

This commit backports a tool introduced at dd4709e which aims at allowing a quick convert from a string holding emails to a list of nicely formatted emails, using normalize version of email addresses. This is the standard we use in most flows.

Task-4376876
Followup of task-3704658

Forward-Port-Of: #189409

@robodoo
Copy link
Contributor

robodoo commented Dec 9, 2024

Pull request status dashboard

@robodoo robodoo added forwardport This PR was created by @fw-bot conflict There was an error while creating this forward-port PR labels Dec 9, 2024
@fw-bot
Copy link
Contributor Author

fw-bot commented Dec 9, 2024

@tde-banana-odoo cherrypicking of pull request #189409 failed.

stdout:

Auto-merging addons/mail/models/mail_mail.py
CONFLICT (content): Merge conflict in addons/mail/models/mail_mail.py
Auto-merging addons/test_mail/tests/test_mail_gateway.py
CONFLICT (content): Merge conflict in addons/test_mail/tests/test_mail_gateway.py
Auto-merging addons/test_mail/tests/test_mail_mail.py
CONFLICT (content): Merge conflict in addons/test_mail/tests/test_mail_mail.py
Auto-merging odoo/tools/mail.py

Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).

In the former case, you may want to edit this PR message as well.

⚠️ after resolving this conflict, you will need to merge it via @robodoo.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@C3POdoo C3POdoo added the RD research & development, internal work label Dec 9, 2024
@tde-banana-odoo tde-banana-odoo force-pushed the 17.0-16.0-mail-validation-tde-ZSQp-fw branch 2 times, most recently from 4cda95b to 3bade66 Compare December 9, 2024 10:27
@C3POdoo C3POdoo requested review from a team, Gorash and xmo-odoo and removed request for a team December 9, 2024 10:28
When preparing final outgoing email, partner email is normalized. We
take their formatted email, which is their name and their normalized
email. However email_to and email_cc are taken from input using
'email_split(_and_format)', which finds emails but do not format them.

This leads to incoherent behavior as most emails are normalized as
we generally always use partners, but not all. In this commit we now
split, normalize and format email_to and email_cc in outgoing emails.

This fixes a first issue where name are lost if a formatted email was
entered in email_cc field. Only address was kept, now the name is
correctly found and put back.

This also fixes an issue for validated email detection, in order to
compare normalized emails. This was introduced at odoo#185793
and may skip valid emails entered in email_to or email_cc.

This commit backports a tool introduced at odoo/odoo@dd4709e which
aims at allowing a quick convert from a string holding emails to a list
of nicely formatted emails, using normalize version of email addresses.
This is the standard we use in most flows.

Task-4376876
Followup of task-3704658

X-Original-Commit: odoo/odoo@2baa481
@tde-banana-odoo tde-banana-odoo force-pushed the 17.0-16.0-mail-validation-tde-ZSQp-fw branch from 3bade66 to 9729ffa Compare December 11, 2024 07:59
Due to history reasons, input given when inviting users is parsed in a
simple way. However this create issues, notably because Odoo heavily
relies on normalized emails.

We therefore use the same heuristics as when creating partners given
a potentially formatted input.

Task-4376876
Followup of task-3704658

X-Original-Commit: odoo/odoo@bdccc57
@tde-banana-odoo tde-banana-odoo force-pushed the 17.0-16.0-mail-validation-tde-ZSQp-fw branch from 9729ffa to 74ff80b Compare December 11, 2024 14:25
@tde-banana-odoo
Copy link
Contributor

@robodoo r+ rebase-ff

@robodoo
Copy link
Contributor

robodoo commented Dec 11, 2024

Merge method set to rebase and fast-forward.

@robodoo
Copy link
Contributor

robodoo commented Dec 11, 2024

@tde-banana-odoo staging failed: ci/runbot (view more at https://runbot.odoo.com/runbot/build/71863130)

@tde-banana-odoo
Copy link
Contributor

@robodoo retry

@robodoo
Copy link
Contributor

robodoo commented Dec 12, 2024

@tde-banana-odoo staging failed: ci/runbot on 6629d8663218076d5d0c7fa8120d488b26fa0814 (view more at https://runbot.odoo.com/runbot/build/71897254)

@tde-banana-odoo
Copy link
Contributor

@robodoo retry

robodoo pushed a commit that referenced this pull request Dec 12, 2024
When preparing final outgoing email, partner email is normalized. We
take their formatted email, which is their name and their normalized
email. However email_to and email_cc are taken from input using
'email_split(_and_format)', which finds emails but do not format them.

This leads to incoherent behavior as most emails are normalized as
we generally always use partners, but not all. In this commit we now
split, normalize and format email_to and email_cc in outgoing emails.

This fixes a first issue where name are lost if a formatted email was
entered in email_cc field. Only address was kept, now the name is
correctly found and put back.

This also fixes an issue for validated email detection, in order to
compare normalized emails. This was introduced at #185793
and may skip valid emails entered in email_to or email_cc.

This commit backports a tool introduced at dd4709e which
aims at allowing a quick convert from a string holding emails to a list
of nicely formatted emails, using normalize version of email addresses.
This is the standard we use in most flows.

Task-4376876
Followup of task-3704658

X-original-commit: 2baa481
Part-of: #190033
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
robodoo pushed a commit that referenced this pull request Dec 12, 2024
Due to history reasons, input given when inviting users is parsed in a
simple way. However this create issues, notably because Odoo heavily
relies on normalized emails.

We therefore use the same heuristics as when creating partners given
a potentially formatted input.

Task-4376876
Followup of task-3704658

closes #190033

X-original-commit: bdccc57
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
@tde-banana-odoo
Copy link
Contributor

@robodoo retry

@robodoo
Copy link
Contributor

robodoo commented Dec 12, 2024

@tde-banana-odoo retry makes no sense when the PR is not in error.

@robodoo robodoo closed this Dec 12, 2024
tde-banana-odoo added a commit to odoo-dev/odoo that referenced this pull request Dec 12, 2024
Due to history reasons, input given when inviting users is parsed in a
simple way. However this create issues, notably because Odoo heavily
relies on normalized emails.

We therefore use the same heuristics as when creating partners given
a potentially formatted input.

Task-4376876
Followup of task-3704658

closes odoo#190033

X-original-commit: odoo/odoo@bdccc57
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
robodoo pushed a commit that referenced this pull request Dec 12, 2024
Due to history reasons, input given when inviting users is parsed in a
simple way. However this create issues, notably because Odoo heavily
relies on normalized emails.

We therefore use the same heuristics as when creating partners given
a potentially formatted input.

Task-4376876
Followup of task-3704658

closes #190033

closes #190531

X-original-commit: bdccc57
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
fw-bot pushed a commit to odoo-dev/odoo that referenced this pull request Dec 12, 2024
Due to history reasons, input given when inviting users is parsed in a
simple way. However this create issues, notably because Odoo heavily
relies on normalized emails.

We therefore use the same heuristics as when creating partners given
a potentially formatted input.

Task-4376876
Followup of task-3704658

closes odoo#190033

X-original-commit: 0116f66
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
robodoo pushed a commit that referenced this pull request Dec 12, 2024
Due to history reasons, input given when inviting users is parsed in a
simple way. However this create issues, notably because Odoo heavily
relies on normalized emails.

We therefore use the same heuristics as when creating partners given
a potentially formatted input.

Task-4376876
Followup of task-3704658

closes #190033

closes #190588

X-original-commit: 0116f66
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
tde-banana-odoo added a commit to odoo-dev/odoo that referenced this pull request Dec 16, 2024
Due to history reasons, input given when inviting users is parsed in a
simple way. However this create issues, notably because Odoo heavily
relies on normalized emails.

We therefore use the same heuristics as when creating partners given
a potentially formatted input.

Task-4376876
Followup of task-3704658

closes odoo#190033

closes odoo#190531

X-original-commit: odoo/odoo@bdccc57
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
robodoo pushed a commit that referenced this pull request Dec 16, 2024
Due to history reasons, input given when inviting users is parsed in a
simple way. However this create issues, notably because Odoo heavily
relies on normalized emails.

We therefore use the same heuristics as when creating partners given
a potentially formatted input.

Task-4376876
Followup of task-3704658

closes #190033

closes #190531

closes #190594

X-original-commit: bdccc57
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
@fw-bot fw-bot deleted the 17.0-16.0-mail-validation-tde-ZSQp-fw branch December 26, 2024 13:26
gamarino pushed a commit to numaes/numa-public-odoo that referenced this pull request Jan 24, 2025
Due to history reasons, input given when inviting users is parsed in a
simple way. However this create issues, notably because Odoo heavily
relies on normalized emails.

We therefore use the same heuristics as when creating partners given
a potentially formatted input.

Task-4376876
Followup of task-3704658

closes odoo/odoo#190033

closes odoo/odoo#190588

X-original-commit: 0116f6624439197f2dd875672cf6f3b1d4dfafda
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflict There was an error while creating this forward-port PR forwardport This PR was created by @fw-bot RD research & development, internal work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants