KantoorWeb.Mail.MessagePane (Kantoor v1.0.0)

The open message of the webmail: headers, plain text, or sanitised HTML in a sandboxed iframe, attachments, the message actions and the invitation card. A LiveComponent of KantoorWeb.Mail.InboxLive, so the list stays where it is while the message changes.

All mail content is hostile: text is escaped by HEEx; HTML only reaches the page through Kantoor.Webmail.HtmlSanitizer inside an iframe whose sandbox has no allow-scripts and no allow-same-origin.

The page passes current_scope, mailbox, folders, message_id, the number of panes (:two or :three), the search query the list shows and the ids of the newer_id/older_id messages (for the back and step buttons). The component loads the message when message_id changes (and marks it read), and asks the page to flash, close the pane or leave with messages {:message_pane, {:flash, kind, text}}, {:message_pane, {:closed, folder_id, notice}} and {:message_pane, :gone}. The page can send it refresh: true (the message changed elsewhere) or action: :delete.