From bdc2f6e00e0e803a5aed458a3104e30d4b375a43 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Mon, 26 Sep 2022 14:27:34 +0000 Subject: [PATCH] [FIX] mail: outlook 365 warning not hiding mail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It seems that there is a rather frequent warning that can be added to mail received by outlook 365 and that has the form: ``` ...Caution: This is an external email and has a suspicious subject or content...
``` The combination of `align="left" width="100%"` means that a div after this alert will probably have a width of 0 (because the previous content is floating to the left, and taking 100% of width so there is 0 pixel of width remaining). This is not an issue in general, but in Odoo this conflicts with a code that adds scrollbar if a message content overflows (but here since width is 0 pixel the content is just hidden). With this commit, if we detect the code that is used in all our received report (width=100% and float=left), we ignore the float to prevent this issue from happening. An alternative is to avoid Outlook 365 adding this structure in a message (see [1]), but this is only possible if we can change the configuration where this structure is added (eg. we can't if it is a customer that is forwarding a mail already broken). [1]: https://learn.microsoft.com/en-us/microsoft-365/security/office-365-security/set-up-anti-phishing-policies?view=o365-worldwide#first-contact-safety-tip opw-2887342 opw-2925222 opw-2946587 closes odoo/odoo#102107 X-original-commit: ed7280ce8f79ff68904310ca1120cb9c5ee735ae Signed-off-by: Alexandre Kühn (aku) Signed-off-by: Nicolas Lempereur (nle) --- addons/mail/static/src/components/message/message.scss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/mail/static/src/components/message/message.scss b/addons/mail/static/src/components/message/message.scss index 49f2ff13165..b2a1f6fa485 100644 --- a/addons/mail/static/src/components/message/message.scss +++ b/addons/mail/static/src/components/message/message.scss @@ -21,6 +21,12 @@ // may impact the bullet point (at least it does on Safari). max-width: 100%; overflow-x: auto; + + // overflow: auto can break rendering of next element of a frequent broken Outlook 365 + // warning table. If detected, we prevent the issue by removing flotation. + &table[align="left"][width="100%"] { + float: none; + } } img {