Commit Graph
67 Commits
Author SHA1 Message Date
soconnor 35e4d3da86 fix: make docker build/push work with Gitea
CI / lint (push) Successful in 9m22s
CI / build (push) Successful in 9m21s
Build & Push Container Image / build-and-push (push) Successful in 48s
CI / docker (push) Successful in 23s
- Replace type=gha cache (broken on Gitea: unparseable runtime token)
  with type=registry cache using image-manifest/oci-mediatypes options
  that the Gitea registry accepts.
- Push with a Gitea PAT (REGISTRY_TOKEN) since the auto job token
  cannot publish OCI images to the package repo.
- Add registry login to the CI docker smoke-test job.
2026-08-02 16:54:15 -04:00
soconnor 6d1d274457 fix: make ruff lint pass in CI
CI / lint (push) Successful in 4s
CI / build (push) Successful in 9m20s
Build & Push Container Image / build-and-push (push) Failing after 10s
CI / docker (push) Successful in 28s
Add .ruff.toml ignoring BLE001/S110 (intentional mail parsing), apply
ruff auto-fixes (imports, Optional->X|None), and fix format, shebang and
PORT env default.
2026-08-02 16:23:46 -04:00
soconnor b3e44d8ffb fix: update branch references from main to master in CI and publish workflows
CI / lint (push) Failing after 41s
CI / build (push) Successful in 9m33s
CI / docker (push) Skipped
Build & Push Container Image / build-and-push (push) Failing after 2m13s
2026-08-02 16:09:26 -04:00
soconnor a04bd8dedb feat: add CI and publish workflows for container image 2026-08-02 16:07:38 -04:00
soconnor eee315fe3d fix read-only behavior 2026-08-02 16:07:16 -04:00
0xKandGitHub 604fb38937 Merge pull request #15 from kacperkwapisz/add-mit-license
docs: add MIT license
2026-06-25 01:04:26 +02:00
Kacper Kwapisz 93e3de3e84 docs: add MIT license 2026-06-25 01:02:57 +02:00
0xKandGitHub 2b45db5f5e Merge pull request #14 from kacperkwapisz/fix/issue-5-watcher-uid-tracking
Watcher: UID-based tracking + persist cursor across reconnects
2026-04-29 11:16:28 +02:00
Kacper Kwapisz 23d4b1fc79 Merge remote-tracking branch 'origin/main' into fix/issue-5-watcher-uid-tracking 2026-04-29 11:16:20 +02:00
0xKandGitHub 9824c5d6bf Merge pull request #13 from kacperkwapisz/fix/issue-9-mcp-key-tunnel-mode
Skip MCP_API_KEY generation in tunnel mode
2026-04-29 11:16:10 +02:00
0xKandGitHub 329df8afc3 Merge pull request #12 from kacperkwapisz/fix/issue-10-imap-id-command
Send IMAP ID after login (fixes netease login rejection)
2026-04-29 11:16:06 +02:00
Kacper Kwapisz c88ea40459 Persist watcher UID cursor across reconnects
The IDLE watcher previously re-baselined last_seen_uid on every
reconnect (e.g. after iCloud's unsolicited FETCH FLAGS responses
during IDLE caused idle_check to raise). Mail that arrived during the
short disconnect window had a UID below the new baseline and was
silently dropped, so Poke never saw it.

Hoist last_seen_uid and last_uidvalidity to the outer reconnect loop
so the cursor survives transient disconnects. Reset only on first run
or when UIDVALIDITY changes (which means the server has reassigned
UIDs and the previous cursor is meaningless).

Apply the same fix to _poll_folder via a shared mutable cursor dict so
non-IDLE servers also retain their cursor across poll-error reconnects.

Fixes #5
2026-04-29 09:30:15 +02:00
Kacper Kwapisz 68c40055e7 Merge remote-tracking branch 'origin/main' into fix/issue-5-watcher-uid-tracking 2026-04-29 09:28:08 +02:00
Kacper Kwapisz 83a3c482ec Skip MCP_API_KEY generation in tunnel mode
start.sh previously generated and persisted an MCP_API_KEY to .env
unconditionally on first run. In tunnel mode (POKE_TUNNEL=1, the
default) the local server runs unauthenticated and the Poke tunnel
handles auth — generating a key there is at best useless and at worst
overwrites the user's pre-set key, causing 421 errors at the tunnel.

Move .env loading and POKE_TUNNEL resolution above the generation
block, and skip generation entirely when POKE_TUNNEL=1. Re-source .env
after a successful generation so the rest of the script sees the new
value.

Fixes #9
2026-04-29 09:27:59 +02:00
Kacper Kwapisz af796d8583 Send IMAP ID after login for providers that require it (netease)
Some providers (notably netease 163.com / 126.com / yeah.net) reject
clients that don't issue an RFC 2971 ID command after login. Send a
minimal client identification when the server advertises the ID
capability. Failures are logged at debug and never break login.

Fixes #10
2026-04-29 09:25:59 +02:00
0xKandGitHub a2b859dd89 Merge pull request #11 from kacperkwapisz/feat/list-accounts-required-account-id
Add list_accounts tool and require account_id on all email tools
2026-04-29 09:20:28 +02:00
Kacper Kwapisz 5f049c691a Apply ruff format 2026-04-29 09:18:55 +02:00
Kacper Kwapisz c543ed9c47 Add list_accounts tool and require account_id on all email tools
- New list_accounts MCP tool: cheap inbox discovery with no IMAP I/O
- account_id is now required on all 11 per-account tools (no silent
  fallback to first configured account)
- resolve_account: whitespace-tolerant, case-insensitive id matching,
  ambiguity detection on email-address fallback, clear errors that
  point agents at list_accounts
- get_server_info: description clarifies it does live IMAP checks
- Version bumped to 1.1.0
- README: tool count 12 -> 13, breaking-change note, account_id
  requirement called out
2026-04-29 09:12:00 +02:00
0xK 3d4a1cb791 Fix UID-based tracking for already-Seen messages 2026-03-30 16:37:37 +02:00
0xKandGitHub 660b627790 Merge pull request #8 from kacperkwapisz/fix/mark-as-read-readonly
Fix emails marked as read despite mark_as_read: false
2026-03-25 16:47:37 +01:00
Kacper Kwapisz 1d4fe9c4cf Fix emails marked as read despite mark_as_read: false
Open IMAP folder in readonly mode when mark_as_read is false,
preventing FETCH RFC822 from implicitly setting the \Seen flag.
2026-03-25 16:46:10 +01:00
0xKandGitHub 56ebea20e9 Merge pull request #7 from kacperkwapisz/release/v0.1.0
Add GitHub Releases and version-based OTA updates
2026-03-25 15:25:58 +01:00
Kacper Kwapisz 93b6873925 Add GitHub Releases and version-based OTA updates
- Add __version__ = "0.1.0" to src/server.py
- Add release.yml workflow to create GitHub Releases on v* tags
- Refactor start.sh OTA to use GitHub Releases API instead of commit SHAs
2026-03-25 15:10:23 +01:00
0xKandGitHub 906555d73e Merge pull request #6 from kacperkwapisz/feat/mark-as-read-option
Add mark_as_read config option
2026-03-25 14:50:46 +01:00
Kacper Kwapisz 7ac6531248 Fix ruff formatting 2026-03-25 14:49:21 +01:00
Kacper Kwapisz 5a6ae3e94f Add mark_as_read config option to preserve email read status
Emails forwarded to Poke are no longer marked as read by default,
so users can continue using read/unread status to organize their
inbox. Set mark_as_read: true (global or per-account) to restore
the previous behavior.

Closes #5
2026-03-25 14:47:42 +01:00
0xKandGitHub bcc9f89cf9 Merge pull request #4 from kacperkwapisz/fix/detect-drafts-folder
Fix drafts folder detection using non-existent imapclient constant
2026-03-24 16:41:12 +01:00
0xKandGitHub 5a22a54ca0 Merge pull request #1 from kacperkwapisz/feat/poke-login-sdk
feat: integrate Poke login SDK token automation into start.sh
2026-03-24 16:28:55 +01:00
Kacper Kwapisz 7d38b7ed81 Fix detect_drafts_folder using non-existent imapclient.DRAFTS constant
imapclient.DRAFTS does not exist (only imapclient.DRAFT, which is a
message flag, not a folder attribute). Replaced with direct list_folders
iteration checking for the \Drafts special-use flag, matching the
approach used by detect_archive_folder.
2026-03-24 16:16:26 +01:00
0xKandGitHub 772e6bc995 Merge pull request #3 from kacperkwapisz/feat/rate-limiting-and-middleware
Add rate limiting, route filtering, and webhook improvements
2026-03-24 15:57:00 +01:00
Kacper Kwapisz e457f9576c Add .DS_Store to .gitignore 2026-03-24 15:55:58 +01:00
Kacper Kwapisz 2343072c7d Add rate limiting, route filtering, and webhook payload improvements
- Add DropNonMCPRoutes middleware to return empty 404 for non-MCP paths
- Add per-IP sliding window rate limiter with separate GET/POST buckets
- Include account_id and from_address in webhook forwarding payload
- Fix IDLE watcher to always check UNSEEN instead of filtering by EXISTS
- Track seen UIDs to avoid re-forwarding on subsequent IDLE cycles
- Switch to uvicorn.run() with Starlette middleware stack
2026-03-24 15:54:44 +01:00
0xK a52989e7f1 feat: replace git-based OTA with curl + Python tarfile (no git dependency) 2026-03-24 12:02:45 +01:00
0xK eb1bdd5683 fix: auto-install git (brew/apt-get) if missing before OTA check 2026-03-24 12:00:07 +01:00
0xK e12a9bf784 fix: skip OTA update gracefully when git is not installed 2026-03-24 11:58:30 +01:00
0xK ebef198131 feat: add OTA update logic to start.sh (git pull + requirements.txt check) 2026-03-24 11:46:32 +01:00
0xK 581dd0b89a fix: optional MCP_API_KEY in tunnel mode + address Copilot review issues
- start.sh: detect POKE_TUNNEL env var; skip MCP_API_KEY requirement and
  auth when running via poke tunnel (server.py reads the same var)
- start.sh: pass POKE_TOKEN into Python via env var + use json.dumps to
  safely escape quotes/backslashes in YAML (fixes shell-interpolation
  injection risk, Copilot issue #5 / start.sh:72)
- start.sh: anchor MCP_API_KEY guard to non-commented line-start
  assignments and also detect empty value (Copilot issues #1, #8 /
  start.sh:104)
- start.sh: anchor re.sub pattern with re.MULTILINE so only the actual
  assignment line is rewritten, not mid-line occurrences (Copilot
  issue #2)
- start.sh: check re.sub replacement count, warn when poke_api_key key
  is missing from config.yml (Copilot issue #6)
- start.sh: guard npm/npx usage with command -v check; fall back to npx
  poke instead of hard-failing (Copilot issue #3)
- start.sh: use python3 consistently for server.py (Copilot issue #9 /
  start.sh:134)
- start.sh: prefer npx poke tunnel; check command -v poke and fall back
  gracefully (Copilot issue #10 / start.sh:135)
- server.py: honour POKE_TUNNEL=1 — skip bearer-token auth so the poke
  tunnel handles identity; MCP_API_KEY becomes optional in that mode
- README.md: add Node.js/npm prerequisite note (Copilot issue #4)
- README.md: clarify server starts on first run; update AI agent prompt
  (Copilot issue #11 / README.md:48)
2026-03-24 11:40:26 +01:00
0xK 7e94e91753 remove setup.sh — logic moved into start.sh 2026-03-24 10:02:52 +01:00
0xK 37f73e3a9f refactor: merge setup logic into start.sh, remove setup.sh 2026-03-24 10:02:44 +01:00
0xK 45f75d9e12 feat: add setup.sh with Poke login SDK token automation 2026-03-24 09:43:44 +01:00
Kacper Kwapisz 9fe13e5e97 Add update check on start.sh launch
Compares local HEAD against latest main on GitHub and prints a notice
if a newer version is available.
2026-03-23 19:35:05 +01:00
Kacper Kwapisz fef9157c4a Fix GET /mcp 405 log spam and resolve_account email matching
Add a custom GET /mcp health route so health checks and client polling
return 200 instead of flooding logs with 405. Also allow resolve_account
to match by email address (from_address, imap_username, smtp_username)
in addition to account ID.
2026-03-23 19:33:51 +01:00
Kacper Kwapisz bbee0acb13 Move AI agent setup to Quick Start as the primary onboarding path 2026-03-23 19:16:20 +01:00
Kacper Kwapisz 420428e513 Remove one-click deploy buttons, Deployment section, and render.yaml
Non-technical users are covered by the AI agent setup prompt.
Technical users can follow Setup or Docker sections directly.
2026-03-23 19:11:24 +01:00
Kacper Kwapisz 6e1a487676 Use fenced code block for AI agent prompt so GitHub shows copy button 2026-03-23 19:09:48 +01:00
Kacper Kwapisz 2950e5d82c Add AI agent setup prompt, start.sh launcher, and container resource limits
Adds a copy-pasteable prompt for non-technical users to set up poke-mail
via their AI coding agent, a start.sh script that loads .env, activates
the virtualenv, starts the server, and tunnels to Poke, and recommended
container resource limits for orchestrators.
2026-03-23 19:08:31 +01:00
Kacper Kwapisz b3a5cd4c5b Switch webhook endpoint to Poke SDK's /inbound/api-message 2026-03-23 16:38:53 +01:00
Kacper Kwapisz df2dc57600 Fix GHCR image URL to use actual repo owner 2026-03-23 16:29:23 +01:00
Kacper Kwapisz 81945732d1 Update config examples to show iCloud and custom SMTP instead of Gmail 2026-03-23 14:24:29 +01:00
Kacper Kwapisz 2f7853f2bf Add one-click deploy buttons for Render and Railway
Update render.yaml to use Docker runtime with IMAP env vars so the
deploy button prompts users for credentials. Add Railway deploy link.
2026-03-23 14:06:32 +01:00