Skip to content

fix(imap): STARTTLS for non-993 ports#1690

Open
kawacukennedy wants to merge 1 commit into
floatpane:masterfrom
kawacukennedy:fix/imap-tls-mode
Open

fix(imap): STARTTLS for non-993 ports#1690
kawacukennedy wants to merge 1 commit into
floatpane:masterfrom
kawacukennedy:fix/imap-tls-mode

Conversation

@kawacukennedy

@kawacukennedy kawacukennedy commented Jul 20, 2026

Copy link
Copy Markdown

What?

Use STARTTLS for all non-993 IMAP ports, matching the SMTP path logic.

Why?

Fixes #1688

Matcha previously only used STARTTLS on ports 1143 and 143, falling back to implicit TLS on every other port. This broke local IMAP bridges (e.g. Proton Mail Bridge) that serve IMAP on non-standard ports with STARTTLS. Port 993 uses implicit TLS; all other ports now correctly use STARTTLS.

@kawacukennedy
kawacukennedy requested a review from a team as a code owner July 20, 2026 00:44
@floatpanebot floatpanebot added the area/fetcher IMAP fetch / IDLE / search label Jul 20, 2026
@kawacukennedy kawacukennedy changed the title fix(imap): use STARTTLS for all non-993 ports fix(imap): STARTTLS for non-993 ports Jul 20, 2026
@floatpanebot floatpanebot added the size/S Diff: 11–50 lines label Jul 20, 2026
@floatpanebot

floatpanebot commented Jul 20, 2026

Copy link
Copy Markdown
Member

Benchmark report — no significant change

Metrics worse: 0 · better: 0 (threshold: ±3%).

benchstat output
goos: linux
goarch: amd64
pkg: github.com/floatpane/matcha/backend
cpu: AMD EPYC 7763 64-Core Processor                
                           │   old.txt    │               new.txt                │
                           │    sec/op    │    sec/op      vs base               │
ParseSearchQuery_Simple-4    2.585µ ± 17%   2.956µ ± 128%        ~ (p=0.394 n=6)
ParseSearchQuery_Complex-4   7.688µ ± 19%   7.674µ ±  34%        ~ (p=0.699 n=6)
TokenizeSearchQuery-4        3.674µ ± 26%   4.793µ ± 115%        ~ (p=0.169 n=6)
geomean                      4.179µ         4.772µ         +14.19%

                           │  old.txt   │              new.txt               │
                           │    B/op    │    B/op     vs base                │
ParseSearchQuery_Simple-4    26.00 ± 0%   26.00 ± 0%       ~ (p=1.000 n=6) ¹
ParseSearchQuery_Complex-4   762.0 ± 0%   762.0 ± 0%       ~ (p=1.000 n=6) ¹
TokenizeSearchQuery-4        176.0 ± 0%   176.0 ± 0%       ~ (p=1.000 n=6) ¹
geomean                      151.6        151.6       +0.00%
¹ all samples are equal

                           │  old.txt   │              new.txt               │
                           │ allocs/op  │ allocs/op   vs base                │
ParseSearchQuery_Simple-4    2.000 ± 0%   2.000 ± 0%       ~ (p=1.000 n=6) ¹
ParseSearchQuery_Complex-4   23.00 ± 0%   23.00 ± 0%       ~ (p=1.000 n=6) ¹
TokenizeSearchQuery-4        9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                      7.453        7.453       +0.00%
¹ all samples are equal

pkg: github.com/floatpane/matcha/tui
                    │    old.txt    │              new.txt               │
                    │    sec/op     │    sec/op     vs base              │
LogPanelView-4         159.4µ ±  8%   171.4µ ± 19%       ~ (p=0.132 n=6)
SearchOverlayView-4    176.1µ ±  5%   174.2µ ± 13%       ~ (p=0.937 n=6)
InboxConstruction-4   1004.2µ ± 19%   969.5µ ±  7%       ~ (p=0.485 n=6)
geomean                304.3µ         307.0µ        +0.89%

                    │    old.txt    │               new.txt               │
                    │     B/op      │     B/op      vs base               │
LogPanelView-4        33.23Ki ± 34%   44.67Ki ± 0%        ~ (p=0.121 n=6)
SearchOverlayView-4   33.17Ki ± 69%   56.15Ki ± 0%        ~ (p=0.091 n=6)
InboxConstruction-4   874.2Ki ±  0%   874.3Ki ± 0%        ~ (p=0.485 n=6)
geomean               98.77Ki         129.9Ki       +31.54%

                    │   old.txt   │              new.txt              │
                    │  allocs/op  │  allocs/op   vs base              │
LogPanelView-4         713.0 ± 0%    714.0 ± 0%       ~ (p=0.182 n=6)
SearchOverlayView-4    923.5 ± 0%    926.0 ± 0%  +0.27% (p=0.045 n=6)
InboxConstruction-4   3.477k ± 0%   3.478k ± 0%       ~ (p=0.734 n=6)
geomean               1.318k        1.320k       +0.15%

auto-generated by benchmarks.yml

@kawacukennedy
kawacukennedy force-pushed the fix/imap-tls-mode branch 2 times, most recently from a920630 to f362d30 Compare July 20, 2026 08:02
@floatpanebot floatpanebot added the ci CI / build pipeline label Jul 20, 2026
@floatpanebot floatpanebot added the size/M Diff: 51–200 lines label Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/fetcher IMAP fetch / IDLE / search ci CI / build pipeline size/M Diff: 51–200 lines size/S Diff: 11–50 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IMAP forces implicit TLS on any port except 1143/143 — breaks Proton Mail Bridge on non-default ports

2 participants