Skip to content

fix: limit concurrent connections and enforce idle timeouts #89

@Jaro-c

Description

@Jaro-c

Unbounded tokio::spawn per accepted connection → file-descriptor exhaustion under load. No read timeout → Slowloris holds connections open indefinitely.

Fixes

  • SMTP: max 1000 connections per listener (Semaphore); per-read timeout 5 min (RFC 5321 §4.5.3.2)
  • IMAP: max 500 connections per listener; per-read timeout 30 min (RFC 9051 §5.4), covering command loop and IDLE loop

Excess connections are dropped immediately (TCP RST) with a warn log.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:mailMail server / deliveryeffort:SA few hoursprio:P0Critical — drop everythingstatus:triageNeeds triagetype:securitySecurity issue or hardening

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions