Helpdesk alias mail exception
Prevents from adding an mail alias as follower in helpdesk.
Problem
Working with a catchall can create in some situations infinite Mail loops.
Example :
- We have a catchall named : catchall@company.com
- The helpdesk in Odoo is configured to send an automatic email to acknowledge the reception of an email
- The customer has multiple mail accounts forwarded to the catchall inbox
- mail.toto@company.com
- mail.titi@company.com
Normally we recommand that the mail accounts forwarded to the catchall are not used by humans.
But in some cases they are and this can result in infinite mail loops.
> Step 1: Initial Reception
mail.toto@company.com receives an email from customer@gmail.com
- The email is stored in
mail.toto@company.com and forwarded to the catchall
> Step 2: Odoo Processing
- Odoo reads the catchall and creates a ticket for
customer@gmail.com and sends a confirmation email
customer@gmail.com is created or attached to an existing partner in Odoo and is added as follower of the ticket
Up to here everything is normal.
> Step 3: Manual Forward --> Start of the mail loop
Let's say now that a person decides to forward the mail received in mail.toto@company.com to mail.titi@company.com.
- Odoo reads the catchall creates a ticket for
mail.toto@company.com
- A confirmation email is sent to
mail.toto@company.com
mail.toto@company.com is created or attached to an existing partner in Odoo and is added as follower of the ticket
Now we potentially have a mail loop.
Because Odoo sends a confirmation email to mail.toto@company.com who pushed it back to the catchall and so on...
Solving the problem
This module will allow you to configure several forbidden emails through General Configuration or menu Technical > Emails > Mail Catchall Exceptions
The idea is to add the email address of all inboxes forwarded to the catchall.
This list of forbidden emails will be used as follow :
- when a new ticket is received Odoo will check if the sender is in this new parameter. In that case, no ticket is created, confirmation email is not send, and no partner will be created for the sender of the email, hence preventing the creation of a mail loop.
- when creating/updating a partner : using any of those emails as the email field of a partner will not be accepted