{% extends "base.html" %} {% from "components/ui.html" import action, breadcrumb, card, credentials, csrf_field, danger_card, fact, facts with context %} {% from "components/connection.html" import connection_fields %} {% block title %}{{ account.email }} ยท {{ APP_NAME }}{% endblock %} {% block heading %}{{ account.email }}{% endblock %} {% block subheading %}{{ breadcrumb([("Accounts", "/ui/accounts"), (account.email, None)]) }}{% endblock %} {% block actions %} {% if can_audit %}Sends{% endif %} {% if can_verify %}{{ action("/ui/accounts/" ~ account.id ~ "/verify", "Verify", cls="") }}{% endif %} {% if can_read %}Mail{% endif %} {% endblock %} {% block content %} {% set secret_name = "API token" if account.settings.get("auth") == "token" else "password" %} {% if account.status.value == "needs_reauth" %} {% endif %} {% set status_tag %}{% include "partials/account_status.html" %}{% endset %} {% call facts("Account", tags=status_tag) %} {{ fact("Display name", account.display_name) }} {{ fact("Provider", account.provider.value) }} {% if not signs_in_with_oauth %} {% call fact(account.provider.value | upper) %}{{ account.settings.get("host") | or_missing }}{% if account.settings.get("port") %}:{{ account.settings.port }}{% endif %}{% if account.provider.value == "jmap" %}{{ account.settings.get("path", "") }}{% endif %}{% endcall %} {% if account.provider.value != "jmap" %} {% call fact("SMTP") %}{{ account.settings.get("smtp_host") | or_missing }}{% if account.settings.get("smtp_port") %}:{{ account.settings.smtp_port }}{% endif %}{% endcall %} {% endif %} {% endif %} {% call fact("Credentials") %}{{ credentials(account.credentials) }}{% endcall %} {% if sync is not none %} {% call fact("Last sync") %}{{ sync.last_sync_at | when }}{% if sync.last_error %} failed {{ sync.last_error_at | when }} {{ sync.last_error }}{% endif %}{% endcall %} {% endif %} {{ fact("Id", account.id, cls="mono") }} {% endcall %} {% if can_update %} {% call card("Change", meta="A new " ~ secret_name ~ " or new servers are tried first. Nothing is stored unless the provider accepts them." if not signs_in_with_oauth else None) %}
{{ csrf_field() }}
{% if not signs_in_with_oauth %}
Empty: unchanged.
{% endif %}
{% if not signs_in_with_oauth %}
Servers {{ connection_fields(typed.settings if typed else account.settings, security, editing=True, protocol=account.provider.value if account.provider.value in ("pop3", "jmap") else "imap") }}
{% endif %}
{% if signs_in_with_oauth %}
Signed in with {{ account.provider.value | capitalize }}. Sign in again after a password change or when access was revoked. {% set browser = account.provider.value in in_browser %} {% if browser %}
{{ csrf_field() }}
{% endif %}
{{ csrf_field() }}
{% endif %} {% endcall %} {% endif %} {% if can_delete %} {{ danger_card("Remove", "Removes the account and its stored credentials from this service. The mailbox at the provider stays as it is.", "/ui/accounts/" ~ account.id ~ "/delete", "Remove account", "Remove " ~ account.email ~ " from the service?") }} {% endif %} {% endblock %}