{# Fields of a mail policy (add modal, edit page): policy, id (prefix of the element ids), groups (choices: id, name, domain, address), mailboxes (choices), ro, label_class. Groups of a list are sent apart as _groups; without group choices (none in the domain, no access to groups) the group fields are left out and stay unchanged. #} {% set entries = {} %} {% set listed = {} %} {% for key in ['send_allow', 'send_block', 'receive_allow', 'receive_block'] %} {% set plain = [] %} {% set group_ids = [] %} {% for entry in attribute(policy, key)|default([]) %} {% if entry starts with 'group:' %} {% set group_ids = group_ids|merge([entry|slice(6)]) %} {% else %} {% set plain = plain|merge([entry]) %} {% endif %} {% endfor %} {% set entries = entries|merge({(key): plain|join("\n")}) %} {% set listed = listed|merge({(key): group_ids}) %} {% endfor %} {% for side in ['send', 'receive'] %} {{ attribute(lang.mail_policy, side) }}

{{ attribute(lang.mail_policy, side ~ '_info') }}

{{ lang.mail_policy.internal_info }}
{% for list in ['allow', 'block'] %} {% set key = side ~ '_' ~ list %}
{{ attribute(lang.mail_policy, 'entries_info_' ~ side) }} {% if groups %} {% if not ro %}{% endif %} {% endif %}
{% endfor %} {% endfor %}
{{ lang.mail_policy.reject_text_info }}
{{ lang.mail_policy.assign }}

{{ lang.mail_policy.assign_info }}

{% if not ro %}{% endif %}
{% if groups %}
{% if not ro %}{% endif %}
{% endif %}