{# The connection fields of an IMAP or POP3 account, with sending over SMTP, or of a JMAP account, filled in from ``values``. ``protocol``: "imap", "pop3" or "jmap", None where the form lets one choose between IMAP and POP3. ``editing``: the account exists, an emptied field removes that setting. #} {% macro connection_fields(values, security, editing=False, suffix="", protocol="imap") %} {% set ids = "-" ~ suffix if suffix else "" %} {% if protocol == "jmap" %}{{ jmap_fields(values, editing, ids) }}{% else %} {% set ports = {"imap": "993 for tls, 143 for starttls", "pop3": "995 for tls, 110 for starttls"} %} {% set protocol = protocol if not protocol or protocol in ports else "imap" %} {% set incoming = protocol | upper if protocol else "Incoming" %}
Empty: {% if protocol %}{{ ports[protocol] }}{% else %}993 or 143 for IMAP, 995 or 110 for POP3, for tls or starttls{% endif %}.
Empty: the address.
For sending. Empty: this account only reads.
Empty: 465 for tls, 587 for starttls.
Empty: the login name above.
{% if editing %}

Only what you change is sent. A change of server logs in again first.

{% endif %} {% endif %} {% endmacro %} {# A JMAP server: where its session is, and how the account signs in. #} {% macro jmap_fields(values, editing, ids) %}
Empty: 443. Always HTTPS.
Empty: /.well-known/jmap.
With a password. Empty: the address.
{% if editing %}

Only what you change is sent. A change of server logs in again first.

{% endif %} {% endmacro %}