Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FW][FIX] tools.mail: ignore original email during encapsulation #81473

Closed

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Dec 15, 2021

When the system broadcasts an email response to document followers, if the config parameters mail.force.smtp.from or mail.dynamic.smtp.from are defined, it will rewrite the From address to avoid spoofing the sender's domain.

For example, if the mail.catchall.domain is set to example.com and an email response comes from:

"John D" <john@doe.com>

it will rewrite it to:

"John D (john@doe.com)" <notifications@example.com>

This will make sure the system never sends outgoing email for an external domain, as it has no authority for doing so, and that could break mail filtering/authentication rules (SPF, DMARC, etc.)

During this "encapsulation rewrite step", both the original Sender name and their email are preserved, and put into the quoted "name" field of the rewritten address. It seems sensible to preserve as much information as possible about the original sender.

Unfortunately, the inclusion of the Sender email in the final name makes it appear to some inbox providers as if the message is trying to deceptively impersonate another person (as many phishing schemes would).
As of November 2021 GMail at least does this, and will hide the name in the UI when it happens. It will keep only the rewritten email, which is not very useful in the case of a notification (even though it's more technically correct, of course).

This patch removes the original email from the rewritten notification, keeping only the name, considering that the email is not the most important part, and it's better to have one of the two than none.

So after the patch, the rewritten address is now:

"John D" <notifications@example.com>

When there is no name in the original address, we keep only the local part of the email, to avoid the same display issue. The recipient will have to identify the sender based on the context / past messages.

Forward-Port-Of: #79979

@robodoo
Copy link
Contributor

robodoo commented Dec 15, 2021

Pull request status dashboard

@fw-bot
Copy link
Contributor Author

fw-bot commented Dec 15, 2021

Ping @odony cherrypicking of pull request #79979 failed.

stderr:

15:09:51.102970 git.c:344               trace: built-in: git cherry-pick d9cc4c5074f86c5f8d3806bbb5229bcdaa40af48
error: could not apply d9cc4c5074f... [FIX] tools.mail: ignore original email during encapsulation
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
----------
status:

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.

@robodoo robodoo added conflict There was an error while creating this forward-port PR forwardport This PR was created by @fw-bot labels Dec 15, 2021
@C3POdoo C3POdoo added the RD research & development, internal work label Dec 15, 2021
@odony odony force-pushed the 15.0-14.0-encapsulate-noemail-odo-oKks-fw branch from 819b5b0 to bcd3233 Compare December 20, 2021 17:34
@C3POdoo C3POdoo requested a review from a team December 20, 2021 17:36
@odony odony force-pushed the 15.0-14.0-encapsulate-noemail-odo-oKks-fw branch from bcd3233 to f70a142 Compare December 21, 2021 09:57
@C3POdoo C3POdoo requested review from a team December 21, 2021 10:00
@seb-odoo seb-odoo removed the request for review from a team December 21, 2021 10:15
@odony odony force-pushed the 15.0-14.0-encapsulate-noemail-odo-oKks-fw branch from f70a142 to a9cf4a4 Compare December 21, 2021 16:25
When the system broadcasts an email response to document followers,
if the config parameters `mail.force.smtp.from` or
`mail.dynamic.smtp.from` are defined, it will rewrite the `From`
address to avoid spoofing the sender's domain.
**NOTE**: As of 15.0, this is based on the `from_filter` setting on the
corresponding ir.mail_server, rather than the abovementioned config
parameters, but the rest of the discussion stands.

For example, if the `mail.catchall.domain` is set to `example.com` and
an email response comes from:

   "John D" <john@doe.com>

it will rewrite it to:

   "John D (john@doe.com)" <notifications@example.com>

This will make sure the system never sends outgoing email for an external
domain, as it has no authority for doing so, and that could
break mail filtering/authentication rules (SPF, DMARC, etc.)

During this "encapsulation rewrite step", both the original Sender name
and their email are preserved, and put into the quoted "name" field of
the rewritten address. It seems sensible to preserve as much information
as possible about the original sender.

Unfortunately, the inclusion of the Sender email in the final name makes
it appear to some inbox providers as if the message is trying to
deceptively impersonate another person (as many phishing schemes would).
As of November 2021 GMail at least does this, and will hide the name in
the UI when it happens. It will keep only the rewritten email, which is not
very useful in the case of a notification (even though it's more
technically correct, of course).

This patch removes the original email from the rewritten notification,
keeping only the name, considering that the email is not the most
important part, and it's better to have one of the two than none.

So after the patch, the rewritten address is now:

   "John D" <notifications@example.com>

When there is no name in the original address, we keep only the local
part of the email, to avoid the same display issue. The recipient will
have to identify the sender based on the context / past messages.

X-original-commit: 2297302
@odony odony force-pushed the 15.0-14.0-encapsulate-noemail-odo-oKks-fw branch from a9cf4a4 to c242d99 Compare December 22, 2021 09:47
@odony
Copy link
Contributor

odony commented Dec 22, 2021

@robodoo r+ please

@robodoo robodoo closed this in 3c65ec5 Dec 22, 2021
@robodoo robodoo temporarily deployed to merge December 22, 2021 12:30 Inactive
duyphongdn1997 pushed a commit to duyphongdn1997/odoo that referenced this pull request Dec 24, 2021
When the system broadcasts an email response to document followers,
if the config parameters `mail.force.smtp.from` or
`mail.dynamic.smtp.from` are defined, it will rewrite the `From`
address to avoid spoofing the sender's domain.
**NOTE**: As of 15.0, this is based on the `from_filter` setting on the
corresponding ir.mail_server, rather than the abovementioned config
parameters, but the rest of the discussion stands.

For example, if the `mail.catchall.domain` is set to `example.com` and
an email response comes from:

   "John D" <john@doe.com>

it will rewrite it to:

   "John D (john@doe.com)" <notifications@example.com>

This will make sure the system never sends outgoing email for an external
domain, as it has no authority for doing so, and that could
break mail filtering/authentication rules (SPF, DMARC, etc.)

During this "encapsulation rewrite step", both the original Sender name
and their email are preserved, and put into the quoted "name" field of
the rewritten address. It seems sensible to preserve as much information
as possible about the original sender.

Unfortunately, the inclusion of the Sender email in the final name makes
it appear to some inbox providers as if the message is trying to
deceptively impersonate another person (as many phishing schemes would).
As of November 2021 GMail at least does this, and will hide the name in
the UI when it happens. It will keep only the rewritten email, which is not
very useful in the case of a notification (even though it's more
technically correct, of course).

This patch removes the original email from the rewritten notification,
keeping only the name, considering that the email is not the most
important part, and it's better to have one of the two than none.

So after the patch, the rewritten address is now:

   "John D" <notifications@example.com>

When there is no name in the original address, we keep only the local
part of the email, to avoid the same display issue. The recipient will
have to identify the sender based on the context / past messages.

closes odoo#81473

X-original-commit: 2297302
Signed-off-by: Olivier Dony <odo@odoo.com>
@fw-bot fw-bot deleted the 15.0-14.0-encapsulate-noemail-odo-oKks-fw branch January 5, 2022 12:47
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.

None yet

4 participants