Steps to Reproduce
- Start the IMAP server.
- Connect using a real IMAP client (e.g., Thunderbird, Apple Mail) or a custom TCP client.
- 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).
-
Observe that the server does not proceed with authentication and appears to block or timeout.
-
Case 2: Command corruption
A1 AUTHENTICATE PLAIN\r\n
\r\n
A2 LIST "" "*"\r\n
- Observe that:
- Either authentication fails unexpectedly, or
- The next command (LIST) is partially consumed or corrupted.
- Case 3: IDLE DONE not detected
A2 IDLE\r\n
DONE\r\n
- Send both lines quickly.
- 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
Steps to Reproduce
Case 1: AUTHENTICATE hang
Send both lines quickly (in the same TCP packet or without delay).
Observe that the server does not proceed with authentication and appears to block or timeout.
Case 2: Command corruption
Expected Behavior
- Immediately read the continuation input () without blocking
- Detect DONE reliably and exit IDLE mode immediately
Actual Behavior
- Block indefinitely waiting for input that has already been sent
- Over-read and consume bytes belonging to the next command
- Be partially missing or malformed
- Fail to detect DONE and remain stuck
Relevant Logs / Screenshots
No response