Mail workflow
Email workflow with send approval and operation history

A spreadsheet controls permission; a separate state layer handles delivery, copies and recovery.
Work verified against its source.The mail server may accept a message before the spreadsheet status is saved. Simply running the script again can send a duplicate.
A state machine connects Google Sheets, SMTP and IMAP. Permission is checked again before sending, while uncertain outcomes block blind retries.
- Manual spreadsheet permission
- Durable queue
- Duplicate-send protection
- Reply-thread matching
The spreadsheet stays the working interface
Permission belongs to a specific row and address. The current decision is checked again before transmission so cancellations and changed details take effect.
Send state and recovery
Delivery, the sent-folder copy and the spreadsheet update are tracked separately. A later failure must not trigger another send; an uncertain SMTP result requires reconciliation.
Reply tracking
The code reads IMAP headers, matches threads and checks senders. Automatic replies are excluded, and the cursor advances after saving. A live end-to-end check remains a separate task.
Context and limits +
The complete live reply-tracking cycle was not reverified. Delivery rates are not guaranteed, and this is not presented as a bulk-mail service.