{% extends "layout.html" %} {% from "macros/general.html" import display_subnav, nav_links_of_account_types, set_account_status_img, display_button_submit, display_input_cn, display_account_status, display_enabled_services, display_all_admins, display_recipient_bcc, display_sender_bcc, with context %} {% from "macros/policyd.html" import display_policyd_enable_throttling, display_policyd_timeunit_of_throttle, display_policyd_max_messages_per_timeunit, display_policyd_max_message_size_per_timeunit, display_policyd_size_of_single_message, with context %} {% from "macros/msgHandlers.html" import domainMsgHandler with context %} {% block title %}{{ _('Edit account profile') }}{% endblock %} {% block navlinks_active_domains %}class="active"{% endblock %} {% set p = profile[0] %} {% set dn = p[0] %} {% set entries = p[1] %} {% set domainName = entries.get('domainName')[0] %} {% set cn = entries.get('cn', [domainName])[0].decode('utf-8') %} {% set accountStatus = entries.get('accountStatus', ['disabled'])[0] |lower %} {% if profile_type in ['aliases', 'bcc', 'advanced',] %} {% set enabledService = entries.get('enabledService', ['']) %} {% endif %} {% if profile_type == 'general' %} {% set domainAdmin = entries.get('domainAdmin', ['']) %} {% set disclaimer_text = entries.get('disclaimer', [''])[0].decode('utf-8') %} {% elif profile_type == 'aliases' %} {% set domainAliasName = entries.get('domainAliasName', []) %} {% elif profile_type == 'relay' %} {% set mtaTransport = entries.get('mtaTransport', ['dovecot'])[0] %} {% elif profile_type == 'backupmx' %} {% set domainBackupMX = entries.get('domainBackupMX', ['no'])[0] %} {% elif profile_type == 'bcc' %} {% set domainRecipientBccAddress = entries.get('domainRecipientBccAddress', [''])[0] %} {% set domainSenderBccAddress = entries.get('domainSenderBccAddress', [''])[0] %} {% elif profile_type == 'catchall' %} {% set catchallAddress = catchallAccountProfile.get('mailForwardingAddress', ['']) %} {% set catchallAccountStatus = catchallAccountProfile.get('accountStatus', ['disabled'])[0] %} {% elif profile_type == 'advanced' %} {# Get per-domain account settings #} {% set accountSetting = allAccountSettings.get(cur_domain, {}) %} {# Default storage base directory #} {% set defaultStorageBaseDirectory = accountSetting.get('defaultStorageBaseDirectory', '') %} {# Default quota size of new user #} {% set defaultQuota = accountSetting.get('defaultQuota', '0') %} {# Password length #} {% set minPasswordLength= accountSetting.get('minPasswordLength', '0') %} {% set maxPasswordLength= accountSetting.get('maxPasswordLength', '0') %} {# Number of current accounts #} {#{% set domainCurrentQuotaSize = entries.get('domainCurrentQuotaSize', [0])[0] %}#} {% set domainCurrentUserNumber = entries.get('domainCurrentUserNumber', [0])[0] %} {% set domainCurrentListNumber = entries.get('domainCurrentListNumber', [0])[0] %} {% set domainCurrentAliasNumber = entries.get('domainCurrentAliasNumber', [0])[0] %} {# Domain quota #} {% set domainQuota = accountSetting.get('domainQuota', '0:GB') %} {% set domainQuotaSize, domainQuotaUnit = domainQuota.split(':') %} {# Numbers of account limit #} {% set numberOfUsers = accountSetting.get('numberOfUsers', '0') %} {% set numberOfLists = accountSetting.get('numberOfLists', '0') %} {% set numberOfAliases = accountSetting.get('numberOfAliases', '0') %} {# Default mail list #} {% set defaultList = accountSetting.get('defaultList', '') %} {% endif %} {% block breadcrumb %} {% set crumbs = [ (ctx.homepath + '/domains', _('All domains'),), (None, _('Profile of domain:') + ' ' + cur_domain,), (ctx.homepath + '/users/' + cur_domain, _('Users'),), (ctx.homepath + '/maillists/' + cur_domain, _('Mail Lists'),), (ctx.homepath + '/aliases/' + cur_domain, _('Mail Aliases'),), ] %} {{ display_subnav(crumbs) }} {% endblock %} {# Domain profile. #} {% block main %} {# Show system message #} {{ domainMsgHandler(msg) }} {% set navlinks = [ ('general', _('General'), [true,]), ('bcc', _('BCC'), [session.get('domainGlobalAdmin'),]), ('relay', _('Relay'), [session.get('domainGlobalAdmin'),]), ('catchall', _('Catch-all'), [session.get('domainGlobalAdmin'),]), ('aliases', _('Aliases'), [session.get('domainGlobalAdmin'),]), ('throttle', _('Throttling'), [session.get('domainGlobalAdmin'), session.get('enablePolicyd'),]), ('advanced', _('Advanced'), [true,]), ] %}
    {% for nav in navlinks %} {% if not false in nav[2] and not none in nav[2] %}
  • {{ nav[1] }}
  • {% endif %} {% endfor %}

{{ _('Profile of domain:') }} {{ cur_domain }}

{% if profile_type == 'general' %}
{% if session.get('domainGlobalAdmin') is sameas true %} {{ display_account_status(accountStatus, accountType='domain') }} {% endif %} {{ display_input_cn(cn, accountType='domain') }} {% if session.get('domainGlobalAdmin') is sameas true %}
 
{{ display_all_admins(domainAdmins=domainAdmins, allAdmins=allAdmins) }} {% endif %}
{# .col2-3 #} {% if session.get('domainGlobalAdmin') is sameas true %}

{{ _('Export account to') }}

{# .col1-3 #} {% endif %}
{# .columns #} {#-- Disclaimer --#}
 

{{ _('Disclaimer') }}

{{ _('Plain text only')}}
{#-- col2-3 --#}
  • {{ _('Content of disclaimer will be appended to outgoing emails.') }}
{% if session.get('domainGlobalAdmin') is sameas true %}

{{ _('Make sure disclaimer work as expected:') }}

{% endif %}
{# .col1-3 #}
{# .columns #} {% elif profile_type == 'aliases' %} {% if session.get('domainGlobalAdmin') is sameas true %}

{{ _('Enable domain alias') }}

{% if domainAliasName |length > 0 %} {% for d in domainAliasName %}
{% if not loop.first %}

 

{% else %}

{{ _('Alias domains') }}

{% endif %}
{% endfor %} {% endif %} {#-- Always display a empty input field to add new value --#}
{% if domainAliasName |length == 0 %}

{{ _('Alias domains') }}

{% else %}

 

{% endif %}
{# .col2-3 #}
  • {{ _('Emails sent to user@[ALIAS_DOMAIN] will be delivered to user@%s.') |format(cur_domain) }}
{#-- .col1-3 --#}
{#-- .columns --#} {% endif %} {# ------------------ BCC --------------- #} {% elif profile_type == 'bcc' %}

{{ _('Monitor incoming emails via BCC') }}

{{ _('Monitor outgoing emails via BCC') }}

 
{{ display_recipient_bcc(address=domainRecipientBccAddress) }} {{ display_sender_bcc(address=domainSenderBccAddress) }}
{#-- .col2-3 --#}
  • {{ _('Multiple addresses are NOT supported.') }}
  • {{ _('Per-domain bcc settings will override per-user bcc settings.') }}
{#-- .col1-3 --#}
{#-- .columns --#} {% elif profile_type == 'relay' %} {% if session.get('domainGlobalAdmin') is sameas true %}

{{ _('Relay/Transport Setting') }}

{#-- .col2-3 --#}
  • {{ _('Per-user relay setting will override per-domain relay setting you set in this page.') }}
  • {{ _('Sample') }}
{#-- .col1-3 --#}
{#-- .columns --#} {% endif %} {# ------------------ Catch-all --------------- #} {% elif profile_type == 'catchall' %} {% if session.get('domainGlobalAdmin') is sameas true %}

{{ _('Enable catch-all') }}

{{ _('Catch-all Addresses') }}

{#-- .col2-3 --#}

{{ _('Warning') }}: {{ _('Catch-all address may receive many spam emails.') }}

  • {{ _('Emails delivered to non-exist mail accounts will be forwarded to catch-all address(es).') }}
  • {{ _("Multiple addresses MUST be seperated by comma (,).") }}
{#-- .col1-3 --#}
{#-- .columns --#} {% endif %} {# ------------------ Throttle --------------- #} {% elif profile_type == 'throttle' %} {% if session.get('domainGlobalAdmin') is sameas true %} {# ---- Throttling in Policyd ---- #}
{# -- Sender throttle in Policyd -- #} {{ display_policyd_enable_throttling(accountType='sender', enabled=throttleOfSender.get('_from', false)) }} {{ display_policyd_size_of_single_message(value=throttleOfSender.get('_mail_size', 0)) }} {{ display_policyd_max_messages_per_timeunit( value=throttleOfSender.get('_count_max', 0), accountType='sender',) }} {{ display_policyd_max_message_size_per_timeunit( value=throttleOfSender.get('_quota_max', 0), accountType='sender') }} {{ display_policyd_timeunit_of_throttle( value=throttleOfSender.get('_time_limit', 0), accountType='sender') }}
 
{# -- Recipient throttle in Policyd -- #} {{ display_policyd_enable_throttling( accountType='recipient', enabled=throttleOfRecipient.get('_rcpt', false), ) }} {{ display_policyd_max_messages_per_timeunit( value=throttleOfRecipient.get('_count_max', 0), accountType='recipient', ) }} {{ display_policyd_timeunit_of_throttle( value=throttleOfRecipient.get('_time_limit', 0), accountType='recipient', ) }}
{#-- .col2-3 --#}
  • {{ _('Set value to 0 or leave it empty for unlimited.') }}
{#-- .col1-3 --#}
{#-- .columns --#} {% endif %} {# ------------------ Advanced --------------- #} {% elif profile_type == 'advanced' %} {% if session.get('domainGlobalAdmin') is sameas true %}

{{ _('Directory of mailbox storage') }}

{# .col2-3 #}
  • {{ _('Leave it empty to use server-wide default setting.') }}
  • {{ _('Sample') }}: /var/vmail/vmail2
{# .col1-3 #}
{# .columns #} {% endif %}
{% if session.get('domainGlobalAdmin') is sameas true %}
 

{{ _('Domain quota size') }}

{% endif %}

{{ _('Default quota of new user') }}

{# .form-field #} {% if session.get('domainGlobalAdmin') is sameas true %}
 
 

{{ _('Number of max mail users') }}

{{ _('%s account(s) exist.') |format(domainCurrentUserNumber) }}

{{ _('Number of max mail lists') }}

{{ _('Number of max mail aliases') }}

{% endif %}
 

{{ _('Minimal password length') }}

{{ _('Maximal password length') }}

{# .col2-3 #}
  • {{ _('Set value to 0 for unlimited.') }}
{# .col1-3 #}
{# .columns #}
 
{% set curDefaultList = defaultList.split(',') %}

{{ _('Default mail group(s) of new user') }}

{% for ml in allMaillists %} {% set mlentry = ml[1] %} {% set gmail = mlentry.get('mail')[0] %} {% set group_cn = mlentry.get('cn', [''])[0].decode('utf-8') %} {% if group_cn == '' %} {% set group_cn = gmail.split('@', 1)[0] %} {% endif %}
{% endfor %}
{# .checklist #}
{# .form-field #}
{# .col2-3 #} {# .col1-3 #}
{# .columns #} {% if session.get('domainGlobalAdmin') is sameas true %}
 
{{ display_enabled_services(accountType='domain', enabledService=enabledService) }} {% endif %} {% endif %} {{ display_button_submit() }}
{# .box-wrap #}
{# .box-body #}
{# .content-box #} {% endblock main %}