Commit graph

7 commits

Author SHA1 Message Date
a1e6d84733 Re-add WorkingDirectory to systemd service
WorkingDirectory is required to set the cwd to the project dir for
relative paths like ./state. It was accidentally removed in a previous
edit.

Changes:
- Add WorkingDirectory= to [Service] section
2026-01-04 20:15:22 +09:00
6d8a5002e7 Move OnFailure to [Unit] section
OnFailure directive must be in [Unit], not [Service], for systemd
user services to recognize it.

Changes:
- Move OnFailure from [Service] to [Unit] in email_forwarder.service
2026-01-04 20:13:24 +09:00
a0f40a1327 Add WorkingDirectory to systemd service
Ensure ./state resolves to project_dir/state by setting WorkingDirectory
to the absolute PROJECT_DIR path.

Changes:
- Add WorkingDirectory= to email_forwarder.service
2026-01-04 19:55:27 +09:00
daef4cbc9f Fix systemd variable expansion with shell wrapper
Wrap ExecStartPost in /bin/sh -c to enable variable expansion for
UPTIME_SUCCESS_URL. Add EnvironmentFile to load vars from .env.

Changes:
- Update ExecStartPost to use shell for  expansion
- Add EnvironmentFile=/.env to service
- Update fail service ExecStart similarly
2026-01-04 18:53:06 +09:00
c96bd8ed71 Restructure as runnable Python module
Convert email_forwarder.py to a package with __main__.py for module execution.
Update systemd service to use -m email_forwarder.
Configure pyproject.toml to exclude state/ from packaging.

Changes:
- Create email_forwarder/ package with __init__.py and __main__.py
- Move main script to email_forwarder/email_forwarder.py
- Update ExecStart to python -m email_forwarder
- Add setuptools config to exclude state/ directory
2026-01-04 18:22:42 +09:00
02f6461cbc Rename main.py to email_forwarder.py and fix systemd variable expansion
- Rename main.py to email_forwarder.py for better readability
- Update systemd service to use  in ExecStart and EnvironmentFile,
  remove WorkingDirectory to fix expansion issues
- Update install.sh and README references
- Drop-in sets PROJECT_DIR for runtime expansion

Changes:
- File rename: main.py -> email_forwarder.py
- Service: ExecStart and EnvironmentFile now use
- Docs: Updated to reflect new script name
2026-01-04 18:16:37 +09:00
686c4877d3 Implement email forwarder
Add core IMAP forwarding logic with time-based searches and Message-ID
deduplication to prevent duplicates in destination mailbox.

Changes:
- Implement SINCE-based email search using last_run.txt for incremental forwarding
- Add Message-ID extraction and IMAP checks for deduplication
- Configure systemd user services with drop-in overrides for portability
- Integrate Uptime Kuma pings for monitoring
- Set up virtual environment for dependency isolation
- Update documentation and configuration templates
2026-01-04 15:34:31 +09:00