3.3 KiB
3.3 KiB
Yoga Email Finder
Monitors an IMAP inbox via IDLE for District Flow Yoga reservation emails and automatically creates events on a CalDAV calendar.
How it works
- On startup it scans all existing emails from
info@districtflowyoga.comand adds any unprocessed reservations to your calendar. - It then enters IMAP IDLE so the server pushes new email notifications instantly — no polling.
- Each processed
Message-IDis recorded in.processed_idsso restarts never create duplicate events.
Installation on Ubuntu Server
1. Copy files to the server
scp -r yoga_email_finder/ youruser@yourserver:/tmp/yoga-email-finder
Or clone/copy however you prefer.
2. Create a dedicated user and install directory
sudo useradd --system --no-create-home --shell /usr/sbin/nologin yoga-email-finder
sudo mkdir /opt/yoga-email-finder
sudo cp /tmp/yoga-email-finder/* /opt/yoga-email-finder/
sudo chown -R yoga-email-finder:yoga-email-finder /opt/yoga-email-finder
3. Create a Python virtual environment and install dependencies
sudo apt install python3 python3-venv -y
sudo -u yoga-email-finder python3 -m venv /opt/yoga-email-finder/venv
sudo -u yoga-email-finder /opt/yoga-email-finder/venv/bin/pip install -r /opt/yoga-email-finder/requirements.txt
4. Create the config file
sudo cp /opt/yoga-email-finder/config.example.yaml /opt/yoga-email-finder/config.yaml
sudo nano /opt/yoga-email-finder/config.yaml
Fill in your IMAP and CalDAV credentials. See config.example.yaml for all options.
Lock down permissions so only the service user can read the credentials:
sudo chown yoga-email-finder:yoga-email-finder /opt/yoga-email-finder/config.yaml
sudo chmod 600 /opt/yoga-email-finder/config.yaml
5. Install and enable the systemd service
sudo cp /opt/yoga-email-finder/yoga-email-finder.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable yoga-email-finder
sudo systemctl start yoga-email-finder
6. Check it's running
sudo systemctl status yoga-email-finder
sudo journalctl -u yoga-email-finder -f
Configuration reference
| Key | Required | Default | Description |
|---|---|---|---|
imap.host |
yes | — | IMAP server hostname |
imap.port |
no | 993 |
IMAP port |
imap.ssl |
no | true |
Use TLS |
imap.username |
yes | — | IMAP login |
imap.password |
yes | — | IMAP password |
imap.folder |
no | INBOX |
Mailbox folder to watch |
caldav.url |
yes | — | CalDAV calendar URL |
caldav.username |
yes | — | CalDAV login |
caldav.password |
yes | — | CalDAV password |
caldav.calendar_name |
no | first calendar | Target calendar name |
sender_filter.email |
no | — | Filter by sender address |
sender_filter.name |
no | — | Filter by sender display name (fallback) |
timezone |
no | system local | IANA timezone for events (e.g. America/New_York) |
class_duration_minutes |
no | 60 |
Assumed class length |
processed_ids_file |
no | .processed_ids |
Path to the duplicate-tracking file |
Updating
sudo systemctl stop yoga-email-finder
sudo cp new-version/yoga_email_finder.py /opt/yoga-email-finder/
sudo systemctl start yoga-email-finder