Skip to content

[ADD] mail_incoming_no_forward: don't forward incoming mails to followers - #369

Open
divad1196 wants to merge 2 commits into
OCA:18.0from
camptocamp:18.0-add-mail_incoming_no_forward
Open

divad1196 wants to merge 2 commits into
OCA:18.0from
camptocamp:18.0-add-mail_incoming_no_forward

Conversation

@divad1196

Copy link
Copy Markdown

Context

Odoo natively behaves like a group chat:

  • Odoo only fills the To: mail header → the receiver don't know the other recipients
  • When someone answers, Odoo forward the mail to all followers

Issues

Odoo forward the mail as <sender name> <catchall address>

  • some mail servers reject it as impersonation (e.g. Microsoft Defender)
  • replies meant for the company only leak to the external followers

→ Odoo must be able to disable forwarding of external answers

Compatilibility

With module like mail_composer_cc_bcc, the sender can decide who will receive the answer.
→ Odoo should not forward the email in that case.

@OCA-git-bot OCA-git-bot added series:18.0 mod:mail_incoming_no_forward Module mail_incoming_no_forward mod:mail_layout_force Module mail_layout_force labels Nov 26, 2026

@TDu TDu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG

body="Test Message",
email_layout_xmlid=self.mail_notification_layout.xml_id,
message_type="email",
message_type="comment",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be better to disable mail_incoming_no_forward module instead of changing what is tested on an other module.
Why do we have this conflict ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of changing what is tested on an other module

The test is wrong, an email coming from Odoo is never of type email.
message_type='email' is for incoming
=> It must be fixed in any case

Why do we have this conflict ?

Because the test in mail_layout_force is wrong.
It tries to send an email but marks it as an incoming email (message_type='email' is for incoming).

This module prevents forwarding an incoming email to the followers
-> When it sees the message_type='email', it stops the message, which is the correct behavior.

@simahawk simahawk left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

"email" is the type of incoming mails.
Outgoing emails must have the type "comment".
@divad1196
divad1196 force-pushed the 18.0-add-mail_incoming_no_forward branch from 34c9db9 to d972a3f Compare November 27, 2026 15:39
…wers

Odoo forwards every incoming mail to all the followers, sent as
`<sender name> <catchall address>`:
- some mail servers reject it as impersonation (e.g. Microsoft Defender)
- replies meant for the company only leak to the external followers
@divad1196
divad1196 force-pushed the 18.0-add-mail_incoming_no_forward branch from d972a3f to 311ef91 Compare November 27, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:mail_incoming_no_forward Module mail_incoming_no_forward mod:mail_layout_force Module mail_layout_force series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants