Switch HouseWatcherClient to public STOCK Act JSON (legacy housestockwatcher.com is down), add httpx/scikit-learn to pyproject, wire SMTP settings through Settings, fix get_session() as a context manager, and use savepoints in TradeLoader so one bad row does not roll back the batch.
3.5 KiB
Email Setup for levkine.ca (Mailcow)
Homelab POTE sends via Mailcow mail.levkine.ca using the shared alerts@levkine.ca mailbox (same as Kuma/Beszel). See ansible docs/guides/smtp-inventory.md.
✅ Configuration Done
The .env file has been created with these settings:
SMTP_HOST=10.0.10.132
SMTP_PORT=587
SMTP_USER=alerts@levkine.ca
SMTP_PASSWORD=YOUR_MAILBOX_PASSWORD_HERE
FROM_EMAIL=alerts@levkine.ca
REPORT_RECIPIENTS=idobkin@gmail.com
🔑 Next Steps
1. Add Your Password
Edit .env and replace YOUR_MAILBOX_PASSWORD_HERE with your actual mailbox password:
nano .env
# Find the line: SMTP_PASSWORD=YOUR_MAILBOX_PASSWORD_HERE
# Replace with: SMTP_PASSWORD=your_actual_password
# Save and exit (Ctrl+X, Y, Enter)
2. Test the Connection
source venv/bin/activate
python scripts/send_daily_report.py --to test@levkin.ca --test-smtp
If successful, you'll see:
SMTP connection test successful!
✓ Daily report sent successfully!
And you should receive a test email at test@levkin.ca!
3. Set Up Automation
Once email is working, set up automated reports:
./scripts/setup_cron.sh
This will:
- Use
test@levkin.cafor sending - Send reports to
test@levkin.ca(or you can specify different recipients) - Schedule daily reports (default: 6 AM)
- Schedule weekly reports (Sundays at 8 AM)
📧 Email Server Details (For Reference)
Based on your Thunderbird setup:
Outgoing SMTP (what POTE uses):
- Host:
mail.levkin.ca - Port:
587 - Security:
STARTTLS(TLS on port 587) - Authentication: Normal password
- Username:
test@levkin.ca
Incoming IMAP (for reading emails in Thunderbird):
- Host:
mail.levkin.ca - Port:
993 - Security:
SSL/TLS - Username:
test@levkin.ca
POTE only uses SMTP (outgoing) to send reports.
🔒 Security Notes
-
Never commit
.envto git!- Already in
.gitignore✅ - Contains sensitive password
- Already in
-
Password Security:
- The password in
.envis the same one you use in Thunderbird - It's stored in plain text locally (secure file permissions recommended)
- Consider using application-specific passwords if your mail server supports them
- The password in
-
File Permissions (On Proxmox):
chmod 600 .env # Only owner can read/write
🎯 Change Recipients
To send reports to different email addresses (not just test@levkin.ca):
Option 1: Edit .env
REPORT_RECIPIENTS=user1@example.com,user2@example.com,test@levkin.ca
Option 2: Override in cron/scripts
# Manual send to different recipient
python scripts/send_daily_report.py --to someone-else@example.com
# The FROM address will still be test@levkin.ca
✅ Testing Checklist
- Updated
.envwith your actual password - Run
python scripts/send_daily_report.py --to test@levkin.ca --test-smtp - Checked inbox at test@levkin.ca (check spam folder!)
- If successful, run
./scripts/setup_cron.shto automate
🐛 Troubleshooting
Error: "SMTP connection failed"
Check:
- Password is correct in
.env - Port 587 is not blocked by firewall
- Mail server is accessible:
telnet mail.levkin.ca 587
Email not received
- Check spam folder in test@levkin.ca
- Check Thunderbird or webmail for the message
- Check POTE logs:
tail -f ~/logs/daily_run.log
"Authentication failed"
- Double-check username is
test@levkin.ca(not justtest) - Verify password is correct
- Ensure account is active in mailcow
You're all set! POTE will send reports from test@levkin.ca 📧