{% extends "base.html" %} {% from "components/ui.html" import action, breadcrumb, csrf_field, dialog_button, dialog_buttons, folder_options, form_dialog, icon, link_button with context %} {% block title %}{{ message.subject | or_missing }} · {{ APP_NAME }}{% endblock %} {% block heading %}{{ message.subject | or_missing }}{% endblock %} {% block subheading %}{{ breadcrumb(trail) }}{% endblock %} {# The header holds what can be done with the message (docs/UI.md 4.4): Reply with its word, the rest as icons, the way back is the breadcrumb. #} {% block actions %} {% set url = "/ui/accounts/" ~ account.id ~ "/mail/" ~ message.id %} {% set compose = "/ui/accounts/" ~ account.id ~ "/compose?" %} {% set mail = "/ui/accounts/" ~ account.id ~ "/mail" %} {% if can.write %} {{ link_button(compose ~ ([('original', message.id), ('action', 'reply_all')] | urlencode), "Reply to all", "reply-all", alone=True) }} {{ link_button(compose ~ ([('original', message.id), ('action', 'forward')] | urlencode), "Forward", "forward", alone=True) }} {% endif %} {% if can_raw %}{{ link_button(url ~ "/raw", "Download original", "download", alone=True, word=True) }}{% endif %} {% if can.flag %} {{ action(url ~ "/flags", "Mark read" if message.unread else "Mark unread", fields={"unread": "0" if message.unread else "1"}, icon="envelope-open" if message.unread else "envelope", alone=True, word=True) }} {{ action(url ~ "/flags", "Unstar" if message.starred else "Star", fields={"starred": "0" if message.starred else "1"}, icon="star-fill" if message.starred else "star", alone=True) }} {% endif %} {% if can.move and tree %}{{ dialog_button("move-message", "Move", "folder-symlink", danger=False) }}{% endif %} {% if can.trash and not in_trash %}{{ action(url ~ "/delete", "Move to the trash", fields={"back": mail}, icon="trash", alone=True) }}{% endif %} {% if can.purge %}{{ action(url ~ "/delete", "Delete for good", confirm="Delete this message for good? This cannot be undone.", cls="small danger", fields={"permanent": "1", "back": mail}, icon="x-octagon", alone=True, word=True) }}{% endif %} {% if can.write %}{{ link_button(compose ~ ([('original', message.id), ('action', 'reply')] | urlencode), "Reply", "reply", cls="primary") }}{% endif %} {% endblock %} {% block content %} {% set url = "/ui/accounts/" ~ account.id ~ "/mail/" ~ message.id %}
From
{{ message.sender | address }}
To
{{ message.to | addresses }}
{% if message.cc %}
Cc
{{ message.cc | addresses }}
{% endif %} {% if message.bcc %}
Bcc
{{ message.bcc | addresses }}
{% endif %} {% if message.reply_to %}
Reply to
{{ message.reply_to | addresses }}
{% endif %}
Date
{{ message.date | when }}
{% set own = message.keywords | own_keywords %} {% if "flags" in account.capabilities %}
Flags
{{ "unread" if message.unread else "read" }}{% if message.starred %}, starred{% endif %} {% for keyword in message.keywords if keyword not in own %}{{ keyword }} {% endfor %}
{% endif %}
Id
{{ message.id }}
{% if "flags" in account.capabilities and (own or can.flag) %}

Keywords

{% for keyword in own %}{{ keyword }}{% if can.flag %}{{ action(url ~ "/keywords", "Remove", fields={"remove": keyword}, cls="small", icon="x-lg", alone=True, name="Remove the keyword " ~ keyword) }}{% endif %}{% else %}{% if not can.flag %}—{% endif %}{% endfor %} {% if can.flag %}
{{ csrf_field() }}
{% endif %}
{% endif %} {% if can.move and tree %} {% call form_dialog("move-message", "Move the message?", "It goes to the folder you choose and leaves this one.") %}
{{ csrf_field() }}
{{ dialog_buttons("Move", "folder-symlink", danger=False) }}
{% endcall %} {% endif %} {% if message.attachments %}

Attachments

{{ message.attachments | length }}
{% for a in message.attachments %} {% endfor %}
{{ a.filename | or_missing }}{{ a.content_type }}{% if a.inline %}, inline{% endif %} {{ a.size | size }} {% if can_attachment %}{{ link_button("/ui/accounts/" ~ account.id ~ "/mail/" ~ message.id ~ "/attachments/" ~ (a.id | segment), "Download", "download", alone=True, name="Download " ~ (a.filename or "the attachment")) }}{% endif %}
{% endif %}

Message

{% if from_html %}Written as HTML, shown here as text.{% elif message.html_body %}Also has an HTML part, not shown.{% endif %}
{% if body %}
{{ body }}
{% else %}
No text.
{% endif %}
{% endblock %}