Skip to content

BUG: TLS sessions are not resumed across reconnects #1174

@andrinoff

Description

@andrinoff

Describe the bug

Every IMAP/SMTP reconnect performs a full TLS handshake. There's no tls.Config.ClientSessionCache configured, so server-issued session tickets are dropped. Reconnect cost on slow networks (or post-IDLE-timeout) is multiple seconds when it could be a single round-trip.

Expected behavior

Configure a tls.LRUClientSessionCache per account (or shared). Verify session resumption is happening with a debug log.

Why it's hard

Both IMAP (via connectWithOptions) and SMTP (tls.Dial) bypass the cache today. The fix is small but has to be applied in three places consistently and the cache lifetime must be tied to account credentials.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions