Appearance
Mail Poller → Z2 Deployment Status
Date: 2026-06-11 Status: DEPLOYED — Live on ct102, systemd timer active (15-min interval)
Deployment Summary
| Component | Status | Detail |
|---|---|---|
| mail-poller.py | Deployed | /opt/hinata/mail-poller/mail-poller.py on ct102 |
| Credentials | Copied | All 5 files from ct103 (Vaultwarden) → ct102 /opt/itachi/credentials/ (0600) |
| systemd timer | Active | hinata-mail-poller.timer enabled, 15-min interval |
| State | Seeded | state.json seeded to current time — only new messages polled |
| Dry-run test | Passed | All 4 accounts connected, tokens refreshed, 0 errors |
| deploy.sh | Deleted | Removed 2026-06-11 (dead-script law); deploy via manual pct push |
Accounts
| Account | Protocol | Test Result |
|---|---|---|
| michael.asolo1@gmail.com | IMAP (imaplib) | Connected, 14,702 msgs in INBOX |
| michael.asolo@hotmail.co.uk | Graph API | Token refreshed, 999 msgs found |
| michael.nnamah@outlook.com | Graph API | Token refreshed, 999 msgs found |
| n.nnamah@outlook.com | Graph API | Token refreshed, 899 msgs found |
Architecture
- Runtime: Python 3.11.2, stdlib only (imaplib + urllib)
- Container: ct102 (Debian 12 bookworm)
- Credentials: Copied from ct103
/opt/itachi/credentials/ - State:
/opt/hinata/mail-poller/state.json - Archive:
/opt/hinata/mail-poller/archive/{account}/{YYYY}/{MM}/{hash}.json - Timer: systemd
hinata-mail-poller.timer(OnBootSec=2min, OnUnitActiveSec=15min)
Bugs Fixed During Deploy
- Gmail credential format:
mail_imap_credential.jsonis a list wrapping a dict — added[0]unwrap - Graph API public client: App registration has no
client_secret— made it optional in token refresh - OAuth scope: Updated to
Mail.Read Mail.ReadWrite offline_accessto match granted scopes - Dry-run IMAP: Was downloading all messages in dry-run — added early-exit to just report counts
- deploy.sh
pct pushbug (historical): Used Mac-local path as source — fixed to SCP→Z2 first, thenpct push. deploy.sh deleted 2026-06-11
Monitoring Commands
bash
# Timer status
ssh z2 'pct exec 102 -- systemctl status hinata-mail-poller.timer'
# Recent logs
ssh z2 'pct exec 102 -- journalctl -u hinata-mail-poller.service -n 50'
# Polling state
ssh z2 'pct exec 102 -- cat /opt/hinata/mail-poller/state.json'
# Archived emails
ssh z2 'pct exec 102 -- find /opt/hinata/mail-poller/archive -name "*.json" | wc -l'