Add systemd service scripts and convenience wrappers to README

This commit is contained in:
KacperLa 2025-11-26 20:05:23 -05:00
parent 28a1fbe59a
commit fd4085773a

View file

@ -44,6 +44,12 @@ python3 email_tunnel.py
Run under a process supervisor (systemd, supervisord, etc.) so restarts and log rotation are handled. Run under a process supervisor (systemd, supervisord, etc.) so restarts and log rotation are handled.
### Systemd helpers
- `email_tunnel.service`: unit file to run the tunnel under systemd (adjust paths/user/group as needed).
- `install_email_tunnel.sh`: installs/enables/starts the service, validating `.env` and byte-compiling the script.
- `uninstall_email_tunnel.sh`: stops, disables, and removes the service unit.
- `logs_email_tunnel.sh`: convenience wrapper around `journalctl` for viewing service logs/status.
## Operational behavior ## Operational behavior
- State tracking: `STATE_FILE` records the last successfully handled UID. It is only advanced after successful delivery, or after a logged `DeliveryError` to avoid reprocessing a permanently failed message. - State tracking: `STATE_FILE` records the last successfully handled UID. It is only advanced after successful delivery, or after a logged `DeliveryError` to avoid reprocessing a permanently failed message.
- Retries: IMAP SEARCH/FETCH and SMTP SEND are retried up to 3 times with small backoff. Persistent failures log and move on. - Retries: IMAP SEARCH/FETCH and SMTP SEND are retried up to 3 times with small backoff. Persistent failures log and move on.