{% for d in drafts %}
{# A draft's row state keys on BOTH send_state and sent_utc, not
send_state alone: `(send_state=='', sent_utc set)` is the
crash-residual -- a draft claimed for sending where a hard crash hit
mid-SMTP-round-trip, before set_send_state ever recorded
delivered/uncertain. It has no stored sent_raw (the crash happened
before the bytes were stored), so it cannot Reopen (409s, claim
held) and cannot Save to Sent (nothing to append) -- only
mark-unsent (clear_send_state) can return it to editable. #}
{% set crashed = d.send_state == "" and d.sent_utc != "" %}
{{ d.subject or "(no subject)" }}{{ d.to_addrs }}
{% if d.send_state == "" and d.sent_utc == "" %}
DraftReopen
{% elif d.send_state == "delivered" %}
Sent — not yet in Sent folder
{% elif d.send_state == "uncertain" %}
Delivery unknown — verify, then:
{% elif crashed %}
Send interrupted — status unknown
We can't tell whether this message went out before
the interruption. Check with the recipient before marking it as
not sent.