{% extends "layout.html" %} {% from "macros/form_inputs.html" import input_submit, input_csrf_token, input_text with context %} {% from "macros/general.html" import display_subnav, set_account_status_img, set_account_activity_img, display_domain_cn, display_preferred_language, display_timezones, display_account_status, display_domain_backupmx, display_relay, display_sender_relayhost, display_domain_quota, display_domain_default_userquota, display_domain_max_user_quota, display_recipient_bcc, display_sender_bcc, display_disabled_account_profiles, display_disabled_domain_mail_services, display_per_account_wblist_all with context %} {% from "macros/sql.html" import display_enabled_domain_services with context %} {% from "macros/iredapd.html" import display_throttle_setting, display_greylisting_setting, display_greylisting_whitelists with context %} {% from "macros/amavisd.html" import display_spam_policy with context %} {% from "macros/msg_handlers.html" import domain_msg_handler with context %} {% block title %}{{ _('Edit account profile') }}{% endblock %} {% block navlinks_domains %}class="active"{% endblock %} {% block breadcrumb %} {% set crumbs = [ (ctx.homepath + '/domains', _('All domains')), ('active', ctx.homepath + '/profile/domain/general/' + cur_domain, _('Profile of domain:') + ' ' + cur_domain), (ctx.homepath + '/users/' + cur_domain, _('Users')), (ctx.homepath + '/mls/' + cur_domain, _('Mailing Lists')), (ctx.homepath + '/aliases/' + cur_domain, _('Aliases')), (ctx.homepath + '/admins/' + cur_domain, _('Admins')), ] %} {% if backend != "pgsql" %} {% set crumbs = crumbs + [(ctx.homepath + '/users/' + cur_domain + '/last_logins', _('Last Logins'))] %} {% endif %} {{ display_subnav(crumbs) }} {% endblock %} {# Domain profile. #} {% block main %} {% if pending_domains %}

{{ _('Mail services are disabled for domain(s): %s, please verify domain ownership first.' | format(pending_domains |join(', '), ctx.homepath)) }}

{% endif %} {# Show system message #} {{ domain_msg_handler(msg) }} {% set enabled_services = domain_settings.get('enabled_services', []) %} {% set disabled_mail_services = domain_settings.get('disabled_mail_services', []) %} {% set disabled_domain_profiles = domain_settings.get('disabled_domain_profiles', []) %} {% set disabled_user_profiles = domain_settings.get('disabled_user_profiles', []) %} {% set disabled_user_preferences = domain_settings.get('disabled_user_preferences', []) %} {% if session.get('is_global_admin') %} {% set navlinks = [ ('general', _('General'), [true]), ('bcc', _('BCC'), [true]), ('relay', _('Relay'), [true]), ('catchall', _('Catch-all'), [true]), ('aliases', _('Aliases'), [true]), ('throttle', _('Throttling'), [session.get('iredapd_enabled')]), ('greylisting', _('Greylisting'), [session.get('iredapd_enabled')]), ('wblist', _('White/Blacklist'), [session.get('amavisd_enable_policy_lookup')]), ('spampolicy', _('Spam Policy'), [session.get('amavisd_enable_policy_lookup')]), ('backupmx', _('Backup MX'), [true]), ('advanced', _('Advanced'), [true]), ] %} {% else %} {% set navlinks = [ ('general', _('General'), [true]), ('bcc', _('BCC'), ['bcc' not in disabled_domain_profiles]), ('relay', _('Relay'), ['relay' not in disabled_domain_profiles]), ('catchall', _('Catch-all'), ['catchall' not in disabled_domain_profiles]), ('aliases', _('Aliases'), ['aliases' not in disabled_domain_profiles]), ('throttle', _('Throttling'), ['throttle' not in disabled_domain_profiles, session.get('iredapd_enabled')]), ('greylisting', _('Greylisting'), ['greylisting' not in disabled_domain_profiles, session.get('iredapd_enabled')]), ('wblist', _('White/Blacklist'), [(session.get('amavisd_enable_policy_lookup') and 'wblist' not in disabled_domain_profiles)]), ('spampolicy', _('Spam Policy'), [(session.get('amavisd_enable_policy_lookup') and 'spampolicy' not in disabled_domain_profiles)]), ('backupmx', _('Backup MX'), ['backupmx' not in disabled_domain_profiles]), ('advanced', _('Advanced'), [true]), ] %} {% endif %}
{#-- Links --#}
    {% for nav in navlinks %} {% if not false in nav[2] and not none in nav[2] %}
  • {{ nav[1] }}
  • {% endif %} {% endfor %}

{{ set_account_activity_img('sent', 'domain', cur_domain, float=false) }}

{# .box-header #}
{# profile_type: general #}
{{ input_csrf_token() }}
{% if cur_domain not in pending_domains %} {# normal admin, and not domain ownership verification required #} {{ display_account_status(profile.active, account_type='domain') }} {% endif %} {{ display_domain_cn(cn=profile.description) }}
{# .col2-3 #}
{% if session.get('is_global_admin') or session.get('create_new_domains') %}
{{ display_domain_quota( quota=profile.maxquota | int, required=(session.get('create_new_domains') and (creation_limits['num_max_quota'] > 0)), num_allocated_quota=creation_limits['num_allocated_quota'], num_max_quota=creation_limits['num_max_quota'], num_spare_quota=creation_limits['num_spare_quota'], ) }}
{# .col2-3 #} {% if session.get('is_global_admin') %}
  • {{ _('Set to 0 for unlimited.') }}
{% endif %}
{# .columns #} {% endif %}
 
{% set default_user_quota = domain_settings.get('default_user_quota', '0') | int %} {% set max_user_quota = domain_settings.get('max_user_quota', 0) | int %} {{ display_domain_default_userquota(default_user_quota, max_user_quota=max_user_quota) }} {% if session.get('is_global_admin') %} {{ display_domain_max_user_quota(max_user_quota) }} {% endif %}
{# .col2-3 #} {% if session.get('is_global_admin') %}
  • {{ _('Domain admin cannot assign more than max quota to a mail user.') }}
{# .col1-3 #} {% endif %}
{# .columns #} {{ input_submit() }}
{# profile_type: bcc #} {% if session.get('is_global_admin') or 'bcc' not in disabled_domain_profiles %}
{{ input_csrf_token() }}
{{ display_recipient_bcc(address=profile.rbcc_addr) }} {{ display_sender_bcc(address=profile.sbcc_addr) }}
{#-- .col2-3 --#}
  • {{ _('Multiple addresses are NOT supported.') }}
  • {{ _('Per-user bcc settings has higher priority than per-domain bcc settings.') }}
{#-- .col1-3 --#}
{#-- .columns --#} {{ input_submit() }}
{% endif %} {# profile_type: relay #} {% if session.get('is_global_admin') or 'relay' not in disabled_domain_profiles %}
{{ input_csrf_token() }} {{ display_relay(transport=profile.transport |string, default_mta_transport=default_mta_transport, is_backupmx=profile.backupmx) }}
{{ display_sender_relayhost(relayhost=profile.relayhost) }} {{ input_submit() }}
{% endif %} {# profile_type: catchall #} {% if session.get('is_global_admin') or 'catchall' not in disabled_domain_profiles %}
{{ input_csrf_token() }}

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

{{ _('One mail address per line. Invalid address will be discarded.') }}
{#-- .col2-3 --#}

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

  • {{ _('Emails delivered to non-exist mail accounts will be forwarded to catch-all address(es).') }}
{#-- .col1-3 --#}
{#-- .columns --#} {{ input_submit() }}
{% endif %} {# profile_type: aliases #} {% if session.get('is_global_admin') or 'aliases' not in disabled_domain_profiles %}
{{ input_csrf_token() }}

{{ _('Alias domains') }}

{% if alias_domains %} {% for d in alias_domains |sort %} {% if not loop.first %}

 

{% endif %} {% if d in pending_domains %} {{ _('Domain ownership verification required') }}{% endif %} {% endfor %} {% else %} {% endif %}
{#-- Always display an empty input field to add new value --#}
{% if domainAliasName |length == 0 %}

 

{% else %}

 

{% endif %}
{# .col2-3 #}
  • {{ _('Emails sent to user@[ALIAS_DOMAIN] will be delivered to user@%s.') |format(cur_domain) }}
{#-- .col1-3 --#}
{#-- .columns --#} {{ input_submit() }}
{% endif %} {# profile_type: throttling #} {% if session.get('is_global_admin') or 'throttle' not in disabled_domain_profiles %}
{{ input_csrf_token() }} {% if session.get('iredapd_enabled') %} {# Throttling with iRedAPD #}
{{ input_csrf_token() }} {{ display_throttle_setting(account='@' + cur_domain, setting=outbound_throttle_setting, inout_type='outbound') }} {{ display_throttle_setting(account='@' + cur_domain, setting=inbound_throttle_setting, inout_type='inbound', with_left_border=true) }}
  • {{ _('This throttle setting will be applied to all individual accounts under domain %s.') |format(cur_domain) }}
  • {{ _('You can set per-user throttling in account profile page.') }}
  • {{ _('Per-user throttle setting has higher priority.') }}
{#-- .col1-3 --#}
{# .columns #} {% endif %} {{ input_submit() }}
{# #profile_throttle #} {% endif %} {# profile_type: greylisting, with iRedAPD #} {% if session.get('is_global_admin') or 'greylisting' not in disabled_domain_profiles %} {% if session.get('iredapd_enabled') %}
{{ input_csrf_token() }} {{ display_greylisting_setting(account='@' + cur_domain, gl_setting=gl_setting) }} {{ display_greylisting_whitelists(account='@' + cur_domain, gl_whitelists=gl_whitelists) }} {{ input_submit() }}
{% endif %} {% endif %} {# wblist #} {% if session.get('amavisd_enable_policy_lookup') and (session.get('is_global_admin') or ('wblist' not in disabled_domain_profiles)) %}
{{ input_csrf_token() }} {{ display_per_account_wblist_all(inbound_whitelists=whitelists, inbound_blacklists=blacklists, outbound_whitelists=outbound_whitelists, outbound_blacklists=outbound_blacklists) }} {{ input_submit() }}
{% endif %} {# profile_type: spampolicy #} {% if session.get('amavisd_enable_policy_lookup') and (session.get('is_global_admin') or ('spampolicy' not in disabled_domain_profiles)) %}
{{ input_csrf_token() }} {{ display_spam_policy(account_type='domain', spampolicy=spampolicy, custom_ban_rules=custom_ban_rules, global_spam_score=global_spam_score) }} {{ input_submit() }}
{% endif %} {# profile_type: advanced #}
{{ input_csrf_token() }} {% if session.get('is_global_admin') or session.get('create_new_domains') %}
 

{{ _('Number of max mail users') }} {% if session.get('create_new_domains') %} {% if creation_limits['num_max_users'] > 0 -%}*{% endif %} {% endif %}

{% if session.get('is_global_admin') %} {% elif session.get('create_new_domains') %} {% if creation_limits['num_max_users'] > 0 %} {% endif %} {% endif %}

{{ _('Number of max mail aliases') }} {% if session.get('create_new_domains') %} {% if creation_limits['num_max_aliases'] > 0 -%}*{% endif %} {% endif %}

{% if session.get('is_global_admin') %} {% elif session.get('create_new_domains') %} {% if creation_limits['num_max_aliases'] > 0 %} {% endif %} {% endif %}

{{ _('Number of max mailing lists') }} {% if session.get('create_new_domains') %} {% if creation_limits['num_max_lists'] > 0 -%}*{% endif %} {% endif %}

{% if session.get('is_global_admin') %} {% elif session.get('create_new_domains') %} {% if creation_limits['num_max_lists'] > 0 %} {% endif %} {% endif %}
 
    {% if session.get('is_global_admin') %}
  • {{ _('Set value to 0 or leave it empty for unlimited.') }}
  • {{ _('Set value to -1 means not allowed to create this kind of account.') }}
  • {% elif session.get('create_new_domains') %}
  • {{ _('Leave it empty to use max value.') }}
  • {% endif %}
{% endif %} {# Password length #} {% if session.get('is_global_admin') or ('password_policies' not in disabled_domain_profiles) %}
{% set min_passwd_length = domain_settings.get('min_passwd_length') %} {% set max_passwd_length = domain_settings.get('max_passwd_length') %} {% if session.get('is_global_admin') %} {% set comment_min_passwd_length = none %} {% set comment_max_passwd_length = none %} {% else %} {% if global_min_passwd_length > 0 %} {% set comment_min_passwd_length = _('Can not be shorter than') + ' ' + (global_min_passwd_length | string ) %} {% else %} {% set comment_min_passwd_length = none %} {% endif %} {% if global_max_passwd_length > 0 %} {% if global_min_passwd_length > 0 %} {% set comment_max_passwd_length = _('Can not be shorter than') + ' ' + (global_min_passwd_length | string ) + ' ' + _('or longer than') + ' ' + (global_max_passwd_length | string) %} {% else %} {% set comment_max_passwd_length = _('Can not be longer than') + ' ' + (global_max_passwd_length | string) %} {% endif %} {% else %} {% if global_min_passwd_length > 0 %} {% set comment_max_passwd_length = _('Can not be shorter than') + ' ' + (global_min_passwd_length | string ) %} {% else %} {% set comment_max_passwd_length = none %} {% endif %} {% endif %} {% endif %} {{ input_text(label=_('Minimum password length'), input_name='minPasswordLength', value=min_passwd_length, size=8, comment=comment_min_passwd_length, comment_as_text=True) }} {{ input_text(label=_('Maximum password length'), input_name='maxPasswordLength', value=max_passwd_length, size=8, comment=comment_max_passwd_length, comment_as_text=True) }}
{# .col2-3 #}
  • {{ _('Leave it empty to use server-wide default setting.') }}
{#-- .col1-3 --#}
{#-- .columns --#} {% endif %}
{{ display_preferred_language( value=domain_settings.get('default_language'), languagemaps=languagemaps, label=_('Default language for new user')) }} {{ display_timezones(value=domain_settings.get('timezone'), timezones=timezones) }}
{% if session.get('is_global_admin') or 'bcc' not in disabled_domain_profiles %}
{{ display_recipient_bcc(address=domain_settings.get('default_recipient_bcc', ''), label=_('Default bcc address for incoming emails for new user')) }} {{ display_sender_bcc(address=domain_settings.get('default_sender_bcc', ''), label=_('Default bcc address for outgoing emails for new user')) }}
  • {{ _('These addresses will be assigned to newly created mail user as per-user bcc address.') }}
{% endif %}

{{ _('Default mailing list(s) of new user') }}

{% if domain_settings.get('default_mailing_lists', []) %} {% set default_mailing_lists = domain_settings.get('default_mailing_lists') %} {% else %} {% set default_mailing_lists = [] %} {% endif %} {# Show non-exist lists which still stored in default_mailing_lists #} {% for addr in default_mailing_lists |sort %} {% if addr and addr not in mails_of_all_mailing_lists %}
{% endif %} {% endfor %} {% for rcd in all_mailing_lists %}
{% endfor %}

{{ _('Default mail alias(es) of new user') }}

{% if domain_settings.get('default_groups', []) %} {% set default_groups = domain_settings.get('default_groups') %} {% else %} {% set default_groups = [] %} {% endif %} {# Show non-exist lists which still stored in default_groups #} {% for addr in default_groups |sort %} {% if addr and addr not in mails_of_all_alias_accounts %}
{% endif %} {% endfor %} {% for rcd in all_alias_accounts %}
{% endfor %}
{# Enabled services #} {{ display_enabled_domain_services(enabled_services=enabled_services) }} {# Disabled per-domain mail services #} {% if session.get('is_global_admin') or 'disabled_mail_services' not in disabled_domain_profiles %}
{{ display_disabled_domain_mail_services(disabled_mail_services=disabled_mail_services) }} {% endif %} {% if session.get('is_global_admin') %}
{# Disabled domain profiles #} {{ display_disabled_account_profiles(account_type='domain', disabled_profiles=disabled_domain_profiles) }}
{# Disabled user profiles #} {{ display_disabled_account_profiles(account_type='user', disabled_profiles=disabled_user_profiles) }} {% endif %}
{# Disabled user profiles #} {{ display_disabled_account_profiles(account_type='user_preference', disabled_profiles=disabled_user_preferences) }} {{ input_submit() }}
{# profile_type: backupmx #} {% if session.get('is_global_admin') or 'backupmx' not in disabled_domain_profiles %}
{{ input_csrf_token() }} {{ display_domain_backupmx(domain=cur_domain, backupmx=profile.backupmx, transport=profile.transport) }} {{ input_submit() }}
{% endif %}
{% endblock main %} {% block extra_js %} {% endblock extra_js %}