{% import '_pager.html.twig' as pager %}
{{ pager.view(logs, 'log_show', {'date': date}) }}
{% for row in logs %} {% set invalid = false %} {% set bounced = false %} {% else %} {% endfor %}
{{ row.datetime|date('Y-m-d') }} {{ row.datetime|date('H:i:s') }} {% if row.delivery is not defined and not (row.to starts with "dmarc-reports") %} {% if status[row.id] is defined and status[row.id] is not empty %} {# we have redis record for this ID #} {% if status[row.id] == 'delivered' %} {% elseif status[row.id] == 'queued' %} {% elseif status[row.id] == 'quarantined' %} {% elseif status[row.id] == 'discarded' %} {% elseif status[row.id] == 'bounced' %} {% set bounced = true %} {% else %} {% set invalid = true %} {% endif %} {% elseif row.result is not empty %} {# fallback to old records #} {% if 'Queued' in row.result %} {# we will assume "queued" as success because its better to mark majority as fail/undelivered yet #} {% elseif 'Quarantined' in row.result %} {% elseif 'Discarded' in row.result %} {% else %} {% endif %} {% endif %} {% else %} {% if (row.to starts with "dmarc-reports") or 'success' in row.delivery.result %} {% else %} {% endif %} {% endif %}
{%- if row.auth and row.auth == row.from %} {{ row.auth }} {%- elseif row.auth -%} {{ row.from }} ( {{ row.auth }}) {%- else -%} {% if row.to is not empty and row.to[0] is not empty and row.from is empty %} BOUNCE {% else %} {{ row.from|rich_from }}  {% endif %} {%- if row.ip == '127.0.0.1' or row.ip == '::1' -%} {%- else -%} {{ row.ip|rich_ip(row.reverse) }} {% endif %} {%- endif -%} {% if row.to is not empty and row.to[0] is not empty %} {% for to in row.to %} {% if row.redirects['<' ~ to ~ '>'] is defined %} REDIRECT {% endif %} {{ to }} {% if row.redirects['<' ~ to ~ '>'] is defined %} {% endif %} {%- if not loop.last -%} , {% endif %} {% endfor %} {% elseif row.from is not empty %} {{ 'log.missing'|trans }} {% endif %}
{% if invalid %}
{% if row.delivery is defined %} {{ row.delivery.result|u.truncate(50)|capitalize }} {% elseif row.result is defined %} {{ row.result|u.truncate(50) }} {% endif %}
{% endif %}
{{ row.score is not empty ? row.score|round(1) : '' }} {{ 'log.detail.button'|trans }}
{{ 'log.no_logs'|trans }}
{{ pager.description(logs) }}
export →