{% extends "base.html" %} {% block title %}Logs - Email Server{% endblock %} {% block extra_css %} {% endblock %} {% block content %}

Emails Log

{% if filter_type == 'emails' %} Email Activity {% elif filter_type == 'auth' %} Authentication Activity {% else %} Recent Activity {% endif %}
{% if logs %} {% if filter_type == 'all' %} {% for log_entry in logs %} {% if log_entry.type == 'email' %} {% set log = log_entry.data %}
EMAIL {{ log.mail_from }} → {{ log.rcpt_tos }} {% if log.dkim_signed %} DKIM {% endif %}
{{ log.created_at.strftime('%Y-%m-%d %H:%M:%S') }}
Status: {% if log.status == 'relayed' %} Sent Successfully {% else %} Failed {% endif %}
Message ID: {{ log.message_id }}
{% if log.subject %}
Subject: {{ log.subject }}
{% endif %}
{% else %} {% set log = log_entry.data %}
AUTH {{ log.identifier }} {{ 'Success' if log.success else 'Failed' }}
{{ log.created_at.strftime('%Y-%m-%d %H:%M:%S') }}
Type: {{ log.auth_type.upper() }}
IP: {{ log.ip_address or 'N/A' }}
{% if log.message %}
Message: {{ log.message }}
{% endif %}
{% endif %} {% endfor %} {% elif filter_type == 'emails' %} {% for log in logs %}
{{ log.mail_from }} → {{ log.rcpt_tos }} {% if log.dkim_signed %} DKIM {% endif %}
{{ log.created_at.strftime('%Y-%m-%d %H:%M:%S') }}
Status: {% if log.status == 'relayed' %} Sent {% else %} Failed {% endif %}
Peer: {{ log.peer }}
Message ID: {{ log.message_id }}
{% if log.subject %}
Subject: {{ log.subject }}
{% endif %} {% if log.content and log.content|length > 50 %}
{{ log.content }}
{% endif %}
{% endfor %} {% else %} {% for log in logs %}
{{ log.identifier }} {{ 'Success' if log.success else 'Failed' }}
{{ log.created_at.strftime('%Y-%m-%d %H:%M:%S') }}
Type: {{ log.auth_type.upper() }}
IP: {{ log.ip_address or 'N/A' }}
Result: {% if log.success %} Authenticated {% else %} Rejected {% endif %}
{% if log.message %}
Details: {{ log.message }}
{% endif %}
{% endfor %} {% endif %} {% if has_prev or has_next %} {% endif %} {% else %}

No Logs Found

{% if filter_type == 'emails' %} No email activity has been logged yet. {% elif filter_type == 'auth' %} No authentication attempts have been logged yet. {% else %} No activity has been logged yet. {% endif %}

{% endif %}
{% endblock %} {% block extra_js %} {% endblock %}