[BUG] Buffered reader desynchronization causes AUTHENTICATE hangs and IDLE/DONE handling

Aperta
#249 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
go

Direzione di ricerca

Start at the IMAP server's buffered reader and the AUTHENTICATE and IDLE command handlers; the issue does not name their files, so locate those entry points first. Trace how consecutive lines are read when commands are pipelined, then run or add focused reproductions for AUTHENTICATE followed by LIST and IDLE followed by DONE. Done means continuation input is consumed without blocking or swallowing later commands, and DONE exits IDLE reliably.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
Steps to Reproduce
  1. Start the IMAP server.
  2. Connect using a real IMAP client (e.g., Thunderbird, Apple Mail) or a custom TCP client.
  3. Send pipelined or fast consecutive commands:

Case 1: AUTHENTICATE hang

A1 AUTHENTICATE PLAIN\r\n
\r\n

Send both lines quickly (in the same TCP packet or without delay).

  1. Observe that the server does not proceed with authentication and appears to block or timeout.

  2. Case 2: Command corruption

A1 AUTHENTICATE PLAIN\r\n
\r\n
A2 LIST "" "*"\r\n

  1. Observe that:
  • Either authentication fails unexpectedly, or
  • The next command (LIST) is partially consumed or corrupted.
  1. Case 3: IDLE DONE not detected

A2 IDLE\r\n
DONE\r\n

  1. Send both lines quickly.
  2. Observe that:
  • Server does not exit IDLE mode properly
  • Session appears stuck
Expected Behavior
  • The server should correctly process all client input regardless of TCP packet boundaries or pipelining.
  • AUTHENTICATE should:
    - Immediately read the continuation input () without blocking
  • Commands sent after AUTHENTICATE should remain intact and be processed correctly
  • IDLE should:
    - Detect DONE reliably and exit IDLE mode immediately
Actual Behavior
  • AUTHENTICATE may:
    - Block indefinitely waiting for input that has already been sent
  • AUTHENTICATE may:
    - Over-read and consume bytes belonging to the next command
  • Subsequent commands may:
    - Be partially missing or malformed
  • IDLE may:
    - Fail to detect DONE and remain stuck
Relevant Logs / Screenshots

No response

Lingua principale
Go
Stelle
12
Fork
13
Merge medio
2g 3h
PR unite (30g)
8

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OpenGovMail/raven

Tutte le issue di OpenGovMail/raven

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.