Implement configurable STATE_DIR for state files

Move processed_message_ids.txt and last_run.txt to STATE_DIR,
configurable via .env. Install script creates ./state by default.

Changes:
- Add STATE_DIR to .env.example and config loading
- Update EmailForwarder to use os.path.join for file paths
- Add os.makedirs for state dir creation
- Update README with STATE_DIR option
This commit is contained in:
Jeena 2026-01-04 19:45:48 +09:00
parent 4adce1079f
commit a32f79980e
3 changed files with 13 additions and 10 deletions

View file

@ -19,6 +19,7 @@ This will set up the virtual environment, systemd services, and provide post-ins
- `DEST_USER`: Destination email/username
- `DEST_PASS`: Destination password
- `FOLDERS`: Folders to sync (default "INBOX,Sent"; use "all" for all folders or comma-separated list)
- `STATE_DIR`: Directory for state files (default "./state")
- `DRY_RUN`: Set to `true` for testing without forwarding (default false)
- `UPTIME_SUCCESS_URL`: URL for success ping
- `UPTIME_FAIL_URL`: URL for failure ping