{% from "macros/form_inputs.html" import input_csrf_token with context %} {% from "macros/msg_handlers.html" import general_info with context %} {% macro display_amavisd_quarantined_mails(records, account=None, account_type=None, show_link_for_email=true, show_sender=true, show_recipient=true, sort_by_score=false) -%} {% set current_url = ctx.home + ctx.path %} {% if '/page/' in current_url %} {% set current_url = current_url.split('/page/', 0)[0] %} {% endif %} {% if show_sender %} {% endif %} {% if show_recipient %} {% endif %} {% if sort_by_score %} {% else %} {% endif %} {% if records %} {% for r in records %} {% set sender = r.sender_email |e %} {% set recipient = r.recipient |e %} {% set mailid_orig = r.mail_id |string |e %} {% set mailid_for_js = mailid_orig.replace('+', '') %} {% if show_sender %} {% endif %} {% if show_recipient %} {% endif %} {% if r.content in ['S', 's', 'Y'] %} {% if account_type in ['user', 'domain'] %} {% else %} {% endif %} {% elif r.content in ['V'] %} {% if account_type in ['user', 'domain'] %} {% else %} {% endif %} {% elif r.content in ['B'] %} {% if account_type in ['user', 'domain'] %} {% else %} {% endif %} {% elif r.content in ['H'] %} {% if account_type in ['user', 'domain'] %} {% else %} {% endif %} {% elif r.content in ['M'] %} {% if account_type in ['user', 'domain'] %} {% else %} {% endif %} {% elif r.content in ['C'] %} {% if account_type in ['user', 'domain'] %} {% else %} {% endif %} {% else %} {% endif %} {% endfor %} {% else %} {% set colspan = 8 %} {% if not show_sender %} {% set colspan = colspan - 1 %} {% endif %} {% if not show_recipient %} {% set colspan = colspan - 1 %} {% endif %} {% endif %}
{{ _('Subject') }}{{ _('Sender') }}{{ _('Recipient') }}{{ _('Kind') }} {{ _('Size') }}{{ _('Score') }}{{ _('Score') }}{{ _('Date') }}
{{ r.subject |e |cut_string(length=50) }} {% if show_link_for_email %} {{ sender }} {% else %} {{ sender }} {% endif %} {% if show_link_for_email %} {{ recipient }} {% else %} {{ recipient }} {% endif %} {{ _('Spam') }}{{ _('Spam') }}{{ _('Virus') }}{{ _('Virus') }}{{ _('Spam') }}{{ _('Banned') }}{{ _('Bad Header') }}{{ _('Bad Header') }}{{ _('Bad Mime') }}{{ _('Bad Mime') }}{{ _('Clean') }}{{ _('Clean') }}{{ r.content }}{{ r.size |file_size_format |e }} {{ r.spam_level |e }} {{ r.time_num | epoch_seconds_to_gmt | utc_to_timezone(timezone=session['timezone']) }} more
{{ _('No quarantined mails.') }}
{%- endmacro %} {% macro display_search_modal() -%} {%- endmacro %} {% macro display_idtabs_of_maillog(log_type, account_type, account) -%} {% if session.get('amavisd_enable_logging') and (session.get('disable_viewing_mail_log') is not sameas true) %} {% if account_type is sameas none %}
  • {{ _('Sent Mails') }}
  • {{ _('Received Mails') }}
  • {% else %}
  • {{ _('Sent Mails') }}
  • {{ _('Received Mails') }}
  • {% endif %} {% endif %} {% if session.get('amavisd_enable_quarantine') and (session.get('disable_managing_quarantined_mails') is not sameas true) %} {% if account_type is sameas none %}
  • {{ _('Quarantined Mails') }}
  • {% else %}
  • {{ _('Quarantined Mails') }}
  • {% endif %} {% endif %} {%- endmacro %} {% macro display_icon_of_account_profile(account_type, account) -%} {% if account_type is not sameas none %} {% endif %} {%- endmacro %} {% macro display_spam_policy(account_type, spampolicy, custom_ban_rules=None, global_spam_score=6) -%} {% if spampolicy %} {% set policy_is_empty = False %} {% else %} {% set policy_is_empty = True %} {% endif %} {% set _bypass_spam_checks = spampolicy.get('bypass_spam_checks') %} {% set _bypass_virus_checks = spampolicy.get('bypass_virus_checks') %} {% set _bypass_header_checks = spampolicy.get('bypass_header_checks') %} {% set _bypass_banned_checks = spampolicy.get('bypass_banned_checks') %} {% set _spam_lover = spampolicy.get('spam_lover') %} {% set _virus_lover = spampolicy.get('_virus_lover') %} {% set _banned_files_lover = spampolicy.get('banned_files_lover') %} {% set _bad_header_lover = spampolicy.get('bad_header_lover') %} {% set _spam_quarantine_to = spampolicy.get('spam_quarantine_to') %} {% set _virus_quarantine_to = spampolicy.get('virus_quarantine_to') %} {% set _banned_quarantine_to = spampolicy.get('banned_quarantine_to') %} {% set _bad_header_quarantine_to = spampolicy.get('bad_header_quarantine_to') %} {% set _banned_rulenames = [] %} {# banned_rulenames could be whitespace-separated or comma-separated, we use comma-separated syntax but try to support comma-separated too. #} {# replace whiltespace by comma first, then split by comma #} {% set _sql_banned_rulenames = spampolicy.get("banned_rulenames", "") %} {% if _sql_banned_rulenames %} {% set _banned_rulenames = _sql_banned_rulenames.replace(" ", ",").split(",") %} {% endif %} {% if not spampolicy %} {{ general_info(msg=_('Account does not have specific spam policy yet, server-wide policy will be applied.'), removable=false, trusted=true) }} {% endif %} {% if not custom_ban_rules %} {% set custom_ban_rules = {} %} {% endif %} {# @spampolicy: sql record of `amavisd.policy` #}

    {{ _('Spam checking') }}

     

    {{ _('Virus checking') }}

     

    {{ _('Bad-header checking') }}

     

    {{ _('Banned file type checking') }}

     

    {% if not policy_is_empty %}
    {# col1-3 #} {% endif %}

    {{ _('Ban rules') }}

    {% for (_name, _comment) in [("ALLOW_MS_WORD", _("Allow Microsoft Office Word documents")), ("ALLOW_MS_EXCEL", _("Allow Microsoft Office Excel documents")), ("ALLOW_MS_PPT", _("Allow Microsoft Office PowerPoint documents"))] %}

     

    {% endfor %} {% for _name in custom_ban_rules %}

     

    {% endfor %}
    {# .col2-3 #}
    {# col1-3 #}
    {# .columns #}
    {% if backend != 'pgsql' %}

    {{ _('Prefix text [SPAM] to the subject of spam') }}

    {% endif %}

    {{ _('Mark mail as spam when score is >=') }}

    {% if not global_spam_score %} {% set global_spam_score = 6 %} {% endif %}

    {{ _('Block or quarantine marked spam when score is >=') }}

    {% if not global_spam_kill_score %} {% set global_spam_kill_score = 6.9 %} {% endif %}
    {% if session.get('is_global_admin') %} {% if account_type == 'global' %}

    {{ _('Always insert X-Spam-* headers') }}

    {% endif %} {% endif %}
    {# col2-3 #}
    • {{ _('If many clean mails were marked as spam, please slightly increase the score.') }}
    • {{ _('If many spam message were not classified, please slightly decrease the score.') }}
    {# col1-3 #}
    {%- endmacro %}