{% if session.get('account_is_mail_user') %} {% extends "layout_user.html" %} {% else %} {% extends "layout.html" %} {% endif %} {% from "macros/form_inputs.html" import input_csrf_token with context %} {% from "macros/general.html" import set_account_activity_img, show_pages with context %} {% from "macros/amavisd.html" import display_search_modal, display_idtabs_of_maillog, display_icon_of_account_profile with context %} {% from "macros/msg_handlers.html" import amavisd_msg_handler with context %} {% block title %} {% if log_type == 'sent' %} {{ _('Sent Mails') }} {% elif log_type == 'received' %} {{ _('Received Mails') }} {% endif %} {% endblock %} {% if session.get('account_is_mail_user') %} {% block navlinks_rcvd_mails %}class="active"{% endblock %} {% else %} {% block navlinks_activities %}class="active"{% endblock %} {% endif %} {% block main %} {# Show system message #} {{ amavisd_msg_handler(msg) }} {# Hide sender, recipient, score #} {% set show_sender = True %} {% set show_recipient = True %} {% set show_score = False %} {% if log_type == 'sent' and account_type == 'user' %} {% set show_sender = False %} {% endif %} {% if log_type == 'received' and account_type == 'user' %} {% set show_recipient = False %} {% endif %} {% if session.get('account_is_mail_user') %} {% set show_recipient = False %} {% endif %} {% if log_type == 'received' %} {% set show_score = True %} {% endif %} {% if log_type == 'sent' %} {% if account_type == 'domain' %} {% set tab_title = _('Mails Sent by Domain: %s') |format(account) %} {% set pages_baseurl = ctx.homepath + '/activities/sent/domain/' + account %} {% elif account_type == 'user' %} {% set tab_title = _('Mails Sent by User: %s') |format(account) %} {% set pages_baseurl = ctx.homepath + '/activities/sent/user/' + account %} {% else %} {% set tab_title = _('Sent Mails') %} {% set pages_baseurl = ctx.homepath + '/activities/sent' %} {% endif %} {% elif log_type == 'received' %} {% if account_type == 'domain' %} {% set tab_title = _('Received Mails of Domain: %s') |format(account) %} {% set pages_baseurl = ctx.homepath + '/activities/received/domain/' + account %} {% elif account_type == 'user' %} {% set tab_title = _('Received Mails of User: %s') |format(account) %} {% set pages_baseurl = ctx.homepath + '/activities/received/user/' + account %} {% else %} {% set tab_title = _('Received Mails') %} {% set pages_baseurl = ctx.homepath + '/activities/received' %} {% endif %} {% endif %}
{% if session.get('account_is_mail_user') %} {% set pages_baseurl = ctx.homepath + '/activities/received/user/' + account %} {% else %}
    {{ display_idtabs_of_maillog(log_type=log_type, account_type=account_type, account=account) }}

{{ tab_title }} {% if total is defined and records |length > 0 %} ({{ (cur_page-1) * page_size_limit + 1 }}-{{ (cur_page-1) * page_size_limit + records |length}}/{{ total }}) {% endif %} {% if removeLogsInDays > 0 %} {% endif %} {% if not session.get('account_is_mail_user') %} {{ display_icon_of_account_profile(account_type=account_type, account=account) }} {% endif %}

{% if removeLogsInDays > 0 %} {% endif %} {{ display_search_modal() }}
{# box-header #} {% endif %} {# account_is_mail_user #} {% if account_type %}
{% else %} {% endif %} {{ input_csrf_token() }} {% if show_sender %} {% endif %} {% if show_recipient %} {% endif %} {% if log_type == 'received' -%} {% endif %} {% if records %} {% for r in records %} {% set sender_email = r.sender_email |e %} {% set recipient = r.recipient |e %} {% if log_type == 'sent' %} {# Process recipients #} {% else %} {# Process senders #} {% endif %} {% if show_sender %} {% endif %} {% if show_recipient %} {% endif %} {% if show_score %} {% endif %} {% endfor %} {% else %} {% set colspan = 6 %} {% if log_type == 'sent' %} {# no 'Score' column #} {% set colspan = colspan - 1 %} {% endif %} {% if session.get('account_is_mail_user') %} {# no 'Recipient' column #} {% set colspan = colspan - 1 %} {% endif %} {% if log_type == 'sent' %} {% elif log_type == 'received' %} {% endif %} {% endif %}
{{ _('Subject') }}{{ _('Sender') }}{{ _('Recipient') }}{{ _('Size') }}{{ _('Score') }}{{ _('Date') }}
{{ r.subject |e }}{{ sender_email }} {%- if account_type is sameas none -%} {{ set_account_activity_img('sent', 'user', sender_email, float='right') }} {% endif %} {{ recipient }} {%- if account_type is sameas none -%} {{ set_account_activity_img('received', 'user', recipient, float='right') }} {% endif %} {{ r.size |file_size_format |e }}{{ r.spam_level |e }}{{ r.time_num |epoch_seconds_to_gmt | utc_to_timezone(timezone=session['timezone']) }}
{{ _('No outgoing mails.') }}{{ _('No incoming mails.') }}
{# .tab-footer #}
{# box-body #}
{# content-box #} {% endblock main %}