The project advertises IMAP_PROXY_URL support, but the IMAP watcher never uses it. IMAP connections are always created with a direct TLS dial.
Evidence
requirements.md:67-68 says the watcher must use the proxy when IMAP_PROXY_URL is set
README.md:75 documents IMAP_PROXY_URL as a supported config
internal/config/config.go:60 loads IMAP_PROXY_URL into config
internal/mail/imap.go:71-76 always calls imapclient.DialTLS(addr, options) with no proxy-aware dial path
rg shows no runtime use of IMAPProxyURL outside config loading
Why this is a problem
Deployments that require a SOCKS5 proxy to reach the IMAP server will fail even though the configuration suggests that this is supported.
Expected behavior
When IMAP_PROXY_URL is empty, keep the current direct connection.
When IMAP_PROXY_URL is set, dial IMAP through the configured proxy.
If proxy support is intentionally out of scope, remove the config/docs claim to avoid a false contract.
Impact
This is a real configuration/runtime mismatch: operators can set a documented variable and still get a direct IMAP connection.
## Summary
The project advertises `IMAP_PROXY_URL` support, but the IMAP watcher never uses it. IMAP connections are always created with a direct TLS dial.
## Evidence
- `requirements.md:67-68` says the watcher must use the proxy when `IMAP_PROXY_URL` is set
- `README.md:75` documents `IMAP_PROXY_URL` as a supported config
- `internal/config/config.go:60` loads `IMAP_PROXY_URL` into config
- `internal/mail/imap.go:71-76` always calls `imapclient.DialTLS(addr, options)` with no proxy-aware dial path
- `rg` shows no runtime use of `IMAPProxyURL` outside config loading
## Why this is a problem
Deployments that require a SOCKS5 proxy to reach the IMAP server will fail even though the configuration suggests that this is supported.
## Expected behavior
- When `IMAP_PROXY_URL` is empty, keep the current direct connection.
- When `IMAP_PROXY_URL` is set, dial IMAP through the configured proxy.
- If proxy support is intentionally out of scope, remove the config/docs claim to avoid a false contract.
## Impact
This is a real configuration/runtime mismatch: operators can set a documented variable and still get a direct IMAP connection.
claudecode
was assigned by thuanle2026-04-27 21:06:28 +07:00
IMAP_PROXY_URL được load vào config tại internal/config/config.go.
Docs/requirements vẫn mô tả có hỗ trợ proxy:
README.md (biến IMAP_PROXY_URL)
requirements.md (kết nối IMAP qua proxy khi có cấu hình)
Runtime IMAP hiện tại vẫn luôn dial trực tiếp trong internal/mail/imap.go:
imapclient.DialTLS(addr, options)
không có nhánh nào sử dụng cfg.IMAPProxyURL.
Điều này tạo mismatch giữa contract cấu hình và hành vi runtime.
Proposed implementation plan
Mình đã viết plan chi tiết tại: docs/superpowers/plans/2026-04-27-imap-proxy-support.md
Plan summary
TDD trước cho 2 nhánh kết nối:
proxy unset -> direct dial
proxy set -> proxy dial
Refactor nhỏ trong IMAP watcher để inject dial function (giữ phần login/fetch hiện có).
Implement SOCKS5 dial + TLS handshake cho IMAP khi có IMAP_PROXY_URL.
Bổ sung test validation cho proxy scheme không hợp lệ.
Verify bằng:
go test ./internal/mail -v
go test ./...
Nếu bạn duyệt plan này, mình sẽ tách branch và implement.
## Validation result
Kết luận: **Issue #2 đúng**.
### Evidence verified
- `IMAP_PROXY_URL` được load vào config tại `internal/config/config.go`.
- Docs/requirements vẫn mô tả có hỗ trợ proxy:
- `README.md` (biến `IMAP_PROXY_URL`)
- `requirements.md` (kết nối IMAP qua proxy khi có cấu hình)
- Runtime IMAP hiện tại vẫn luôn dial trực tiếp trong `internal/mail/imap.go`:
- `imapclient.DialTLS(addr, options)`
- không có nhánh nào sử dụng `cfg.IMAPProxyURL`.
Điều này tạo mismatch giữa contract cấu hình và hành vi runtime.
---
## Proposed implementation plan
Mình đã viết plan chi tiết tại:
`docs/superpowers/plans/2026-04-27-imap-proxy-support.md`
### Plan summary
1. **TDD trước** cho 2 nhánh kết nối:
- proxy unset -> direct dial
- proxy set -> proxy dial
2. **Refactor nhỏ** trong IMAP watcher để inject dial function (giữ phần login/fetch hiện có).
3. **Implement SOCKS5 dial + TLS handshake** cho IMAP khi có `IMAP_PROXY_URL`.
4. **Bổ sung test validation** cho proxy scheme không hợp lệ.
5. **Verify** bằng:
- `go test ./internal/mail -v`
- `go test ./...`
Nếu bạn duyệt plan này, mình sẽ tách branch và implement.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
The project advertises
IMAP_PROXY_URLsupport, but the IMAP watcher never uses it. IMAP connections are always created with a direct TLS dial.Evidence
requirements.md:67-68says the watcher must use the proxy whenIMAP_PROXY_URLis setREADME.md:75documentsIMAP_PROXY_URLas a supported configinternal/config/config.go:60loadsIMAP_PROXY_URLinto configinternal/mail/imap.go:71-76always callsimapclient.DialTLS(addr, options)with no proxy-aware dial pathrgshows no runtime use ofIMAPProxyURLoutside config loadingWhy this is a problem
Deployments that require a SOCKS5 proxy to reach the IMAP server will fail even though the configuration suggests that this is supported.
Expected behavior
IMAP_PROXY_URLis empty, keep the current direct connection.IMAP_PROXY_URLis set, dial IMAP through the configured proxy.Impact
This is a real configuration/runtime mismatch: operators can set a documented variable and still get a direct IMAP connection.
Validation result
Kết luận: Issue #2 đúng.
Evidence verified
IMAP_PROXY_URLđược load vào config tạiinternal/config/config.go.README.md(biếnIMAP_PROXY_URL)requirements.md(kết nối IMAP qua proxy khi có cấu hình)internal/mail/imap.go:imapclient.DialTLS(addr, options)cfg.IMAPProxyURL.Điều này tạo mismatch giữa contract cấu hình và hành vi runtime.
Proposed implementation plan
Mình đã viết plan chi tiết tại:
docs/superpowers/plans/2026-04-27-imap-proxy-support.mdPlan summary
IMAP_PROXY_URL.go test ./internal/mail -vgo test ./...Nếu bạn duyệt plan này, mình sẽ tách branch và implement.
Resolved by PR #8
Issue đã được fix qua PR #8: Add IMAP SOCKS5 proxy dialing support (merged).
What changed
internal/mail/imap.go: thêmdialIMAP/dialIMAPViaProxyhooks, branch theoIMAPProxyURLdialTLSViaSOCKS5(): SOCKS5 proxy dial + TLS handshake với timeoutNote
PR #8 thiếu keyword
Fixes #2nên Gitea không auto-close issue. Đóng thủ công lúc này.Closing as fixed.