{% extends 'base.html' %}{% block title %}Email rules · Keywright{% endblock %} {% block body %}{% include '_mail_style.html' %}

Email rules

Match incoming messages and choose what happens next. The first enabled matching rule runs, in priority order.

{% include '_mail_nav.html' %}
{% for entry in rules %}

{{ entry.name }}

{{ 'Enabled' if entry.enabled else 'Paused' }}

{{ 'From '+entry.sender if entry.sender else 'Any sender' }}{% if entry.subject %} · Subject contains “{{ entry.subject }}”{% endif %}

{{ {'pdf':'Send PDF attachments to Budget','mark_read':'Mark as read','move':'Move to folder'}.get(entry.action) }}{% if entry.action == 'move' %}: {{ entry.target }}{% endif %}

Priority {{ entry.position }}Edit
{% else %}
Give incoming mail a jobAdd your electric-bill rule to deliver its PDFs to Budget.
{% endfor %}

{{ 'Edit rule' if rule else 'New rule' }}

Use an address or a pattern such as *@utility.example.

When both filters are set, both must match.

Lower numbers run first.

PDF delivery marks the message read after Budget confirms receipt. Existing messages require Run rules; editing a rule does not resend completed deliveries.

{% if rule %}New rule{% endif %}
{% endblock %}