You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
2.9 KiB

  1. Email Headers
  2. =============
  3. This module is used to improve email deliverability and make sure that replies
  4. find their way to the correct thread in Odoo.
  5. Options:
  6. - Force the `From` and `Reply-To` addresses of outgoing email
  7. - Generate a thread-specific `Reply-To` address for outgoing emails so that
  8. losing the headers used to identify the correct thread won't be a problem
  9. any more.
  10. ## Gotcha
  11. To make the automatic bounce message work when using thread-specific `Reply-To`
  12. addresses, you should define the actual catchall alias in a system parameter
  13. called `mail.catchall.alias.custom` and change the `mail.catchall.alias` to
  14. something completely random that will never be used, or alternatively remove it.
  15. The reason is this: when Odoo is looking for a route for an incoming email that
  16. has lost its headers, it won't check whether the email was sent to
  17. `catchall@whatever.com` but instead it will see if the local part of that address
  18. contains the word `catchall`. And this isn't a good thing when the address is
  19. something like `catchall+123abc@whatever.com`. That's why we had to skip the
  20. default catchall evaluation and redo it in a later phase.
  21. ## Database-specific Settings
  22. | Setting | Purpose | Default value |
  23. |-----------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------|
  24. | email_headers.strip_mail_message_ids | Office 365 emails may add whitespaces before the Message-Id's. This feature removes them. | "True" |
  25. | email_headers.prioritize_replyto_over_headers | When "True", Odoo will prioritize the (unique) Reply-To address of an incoming email and only then look at the `References` and `In-Reply-To` headers. | "True" |
  26. | mail.catchall.alias | The default catchall alias. See "Gotcha" for more information. | "catchall" |
  27. | mail.catchall.alias.custom | The new catchall alias setting. See "Gotcha" for more information. Will be set automatically upon module installation. | mail.catchall.alias value |
  28. ## Debugging
  29. ### Decode and decrypt a message id
  30. ```python
  31. from odoo.addons.email_headers.models.mail import decode_msg_id
  32. decode_msg_id(<encrypted and base32/64 encoded message database id>, self.env)
  33. ```
  34. ### Encrypt and encode a message id
  35. ```python
  36. from odoo.addons.email_headers.models.mail import encode_msg_id
  37. encode_msg_id(<message database id>, self.env)
  38. ```