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.

49 lines
2.9 KiB

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